C# Class NLog.Targets.Wrappers.AsyncTargetWrapper

Inheritance: NLog.Targets.Wrappers.WrapperTargetBase
Exibir arquivo Open project: shiftkey/winrt-backport-hilarity Class Usage Examples

Private Properties

Property Type Description
ProcessPendingEvents void

Public Methods

Method Description
AsyncTargetWrapper ( ) : System

Initializes a new instance of the AsyncTargetWrapper class.

AsyncTargetWrapper ( NLog.Target wrappedTarget ) : System

Initializes a new instance of the AsyncTargetWrapper class.

AsyncTargetWrapper ( NLog.Target wrappedTarget, int queueLimit, AsyncTargetWrapperOverflowAction overflowAction ) : System

Initializes a new instance of the AsyncTargetWrapper class.

Protected Methods

Method Description
CloseTarget ( ) : void

Shuts down the lazy writer timer.

FlushAsync ( AsyncContinuation asyncContinuation ) : void

Waits for the lazy writer thread to finish writing messages.

InitializeTarget ( ) : void

Initializes the target by starting the lazy writer timer.

StartLazyWriterTimer ( ) : void

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

StopLazyWriterThread ( ) : void

Starts the lazy writer thread.

Write ( AsyncLogEventInfo logEvent ) : void

Adds the log event to asynchronous queue to be processed by the lazy writer thread.

The Target.PrecalculateVolatileLayouts is called to ensure that the log event can be processed in another thread.

Private Methods

Method Description
ProcessPendingEvents ( object state ) : void

Method Details

AsyncTargetWrapper() public method

Initializes a new instance of the AsyncTargetWrapper class.
public AsyncTargetWrapper ( ) : System
return System

AsyncTargetWrapper() public method

Initializes a new instance of the AsyncTargetWrapper class.
public AsyncTargetWrapper ( NLog.Target wrappedTarget ) : System
wrappedTarget NLog.Target The wrapped target.
return System

AsyncTargetWrapper() public method

Initializes a new instance of the AsyncTargetWrapper class.
public AsyncTargetWrapper ( NLog.Target wrappedTarget, int queueLimit, AsyncTargetWrapperOverflowAction overflowAction ) : System
wrappedTarget NLog.Target The wrapped target.
queueLimit int Maximum number of requests in the queue.
overflowAction AsyncTargetWrapperOverflowAction The action to be taken when the queue overflows.
return System

CloseTarget() protected method

Shuts down the lazy writer timer.
protected CloseTarget ( ) : void
return void

FlushAsync() protected method

Waits for the lazy writer thread to finish writing messages.
protected FlushAsync ( AsyncContinuation asyncContinuation ) : void
asyncContinuation AsyncContinuation The asynchronous continuation.
return void

InitializeTarget() protected method

Initializes the target by starting the lazy writer timer.
protected InitializeTarget ( ) : void
return void

StartLazyWriterTimer() protected method

Starts the lazy writer thread which periodically writes queued log messages.
protected StartLazyWriterTimer ( ) : void
return void

StopLazyWriterThread() protected method

Starts the lazy writer thread.
protected StopLazyWriterThread ( ) : void
return void

Write() protected method

Adds the log event to asynchronous queue to be processed by the lazy writer thread.
The Target.PrecalculateVolatileLayouts is called to ensure that the log event can be processed in another thread.
protected Write ( AsyncLogEventInfo logEvent ) : void
logEvent AsyncLogEventInfo The log event.
return void