Skip to content

RetryingWrapper target

Rolf Kristensen edited this page Nov 22, 2021 · 12 revisions

Retries in case of write error.

Platforms Supported: All

Configuration Syntax

<targets>
  <target xsi:type="RetryingWrapper" name="String" retryDelayMilliseconds="Integer" retryCount="Integer">
    <target xsi:type="wrappedTargetType" ...target properties... />
  </target>
</targets>

Parameters

General Options

  • name - Name of the target.

Retrying Options

  • retryDelayMilliseconds - Time to wait between retries in milliseconds. Integer Default: 100

  • retryCount - Number of retries that should be attempted on the wrapped target in case of a failure. Integer Default: 3

  • enableBatchWrite - Allow batch writes, and only introduced retry delay once before retrying the batch items one at a time.

    Introduced with NLog 5.0

Notes

When failure occurs, then the retry will perform a synchronous delay. To avoid blocking the application-thread in the retry-sleep, then consider using AsyncWrapper like this:

  • AsyncWrapper -> RetryWrapper -> Actual Target
Clone this wiki locally