<PackageReference Include="NLog" Version="6.1.2" />

NLog.Targets.Wrappers.AsyncTargetWrapper

Provides asynchronous, buffered execution of target writes.
public int BatchSize { get; set; }

Gets or sets the number of log events that should be processed in a batch by the lazy writer thread.

public bool ForceLockingQueue { get; set; }

Gets or sets whether to use the locking queue, instead of a lock-free concurrent queue

public int FullBatchSizeWriteLimit { get; set; }

Gets or sets the number of batches of BatchSize to write before yielding into TimeToSleepBetweenBatches

Gets or sets the action to be taken when the lazy writer thread request queue count exceeds the set limit.

public int QueueLimit { get; set; }

Gets or sets the limit on the number of requests in the lazy writer thread request queue.

public int TimeToSleepBetweenBatches { get; set; }

Gets or sets the time in milliseconds to sleep between batches. (1 or less means trigger on new activity)

Occurs when internal queue size is growing, because internal queue is full and OverflowAction set to Grow

Occurs when LogEvent has been dropped, because internal queue is full and OverflowAction set to Discard

Initializes a new instance of the AsyncTargetWrapper class.

public AsyncTargetWrapper(string name, Target wrappedTarget)

Initializes a new instance of the AsyncTargetWrapper class.

public AsyncTargetWrapper(Target wrappedTarget)

Initializes a new instance of the AsyncTargetWrapper class.

public AsyncTargetWrapper(Target wrappedTarget, int queueLimit, AsyncTargetWrapperOverflowAction overflowAction)

Initializes a new instance of the AsyncTargetWrapper class.

protected virtual bool StartInstantWriterTimer()

Attempts to start an instant timer-worker-thread which can write queued log messages.

protected virtual void StartLazyWriterTimer()

Starts the lazy writer thread which periodically writes queued log messages.

protected virtual void StopLazyWriterThread()

Stops the lazy writer thread.