Clone this wiki locally
A target that buffers log events and sends them in batches to the wrapped target.
Supported in .NET, Silverlight, Compact Framework and Mono.
<targets> <target xsi:type="BufferingWrapper" name="String" slidingTimeout="Boolean" bufferSize="Integer" flushTimeout="Integer"> <target xsi:type="wrappedTargetType" ...target properties... /> </target> </targets>
name - Name of the target.
slidingTimeout - Indicates whether to use sliding timeout.
This value determines how the inactivity period is determined. If sliding timeout is enabled, the inactivity timer is reset after each write, if it is disabled - inactivity timer will count from the first event written to the buffer.
bufferSize - Number of log events to be buffered.
flushTimeout - Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use
-1 to disable timed flushes.
Buffer and asynchronously writing
slidingTimeout is set to
true, then the messages are written asynchronously. There is then no need to use this target in combination with the
async attribute or the AsyncWrapper. Using the
slidingTimeout is preferred over the
async attribute and AsyncWrapper. Combining both can lead to lost messages.
When messages are written asynchronously, this is done in another thread. Some targets require to write on the main thread and so if asynchronous writing is used, the message get lost.