Click or drag to resize

BufferingTargetWrapper Class

A target that buffers log events and sends them in batches to the wrapped target.
Inheritance Hierarchy
SystemObject
  NLog.TargetsTarget
    NLog.Targets.WrappersWrapperTargetBase
      NLog.Targets.WrappersBufferingTargetWrapper

Namespace:  NLog.Targets.Wrappers
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public class BufferingTargetWrapper : WrapperTargetBase

The BufferingTargetWrapper type exposes the following members.

Constructors
  NameDescription
Public methodBufferingTargetWrapper
Initializes a new instance of the BufferingTargetWrapper class.
Public methodBufferingTargetWrapper(Target)
Initializes a new instance of the BufferingTargetWrapper class.
Public methodBufferingTargetWrapper(String, Target)
Initializes a new instance of the BufferingTargetWrapper class.
Public methodBufferingTargetWrapper(Target, Int32)
Initializes a new instance of the BufferingTargetWrapper class.
Public methodBufferingTargetWrapper(Target, Int32, Int32)
Initializes a new instance of the BufferingTargetWrapper class.
Public methodBufferingTargetWrapper(Target, Int32, Int32, BufferingTargetWrapperOverflowAction)
Initializes a new instance of the BufferingTargetWrapper class.
Top
Properties
  NameDescription
Public propertyBufferSize
Gets or sets the number of log events to be buffered.
Public propertyFlushTimeout
Gets or sets the 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.
Protected propertyIsInitialized
Gets a value indicating whether the target has been initialized.
(Inherited from Target.)
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from Target.)
Public propertyName
Gets or sets the name of the target.
(Inherited from Target.)
Public propertyOverflowAction
Gets or sets the action to take if the buffer overflows.
Public propertySlidingTimeout
Gets or sets a value indicating whether to use sliding timeout.
Protected propertySyncRoot
Gets the object which can be used to synchronize asynchronous operations that must rely on the .
(Inherited from Target.)
Public propertyWrappedTarget
Gets or sets the target that is wrapped by this target.
(Inherited from WrapperTargetBase.)
Top
Methods
  NameDescription
Protected methodCloseTarget
Closes the target by flushing pending events in the buffer (if any).
(Overrides TargetCloseTarget.)
Public methodDispose
Closes the target.
(Inherited from Target.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
(Inherited from Target.)
Public methodFlush
Flush any pending log messages (in case of asynchronous targets).
(Inherited from Target.)
Protected methodFlushAsync
Flushes pending events in the buffer (if any), followed by flushing the WrappedTarget.
(Overrides WrapperTargetBaseFlushAsync(AsyncContinuation).)
Protected methodInitializeTarget
Initializes the target before writing starts
(Overrides TargetInitializeTarget.)
Public methodPrecalculateVolatileLayouts
Calls the Precalculate(LogEventInfo) on each volatile layout used by this target. This method won't prerender if all layouts in this target are thread-agnostic.
(Inherited from Target.)
Protected methodRenderLogEvent(Layout, LogEventInfo)
Renders the logevent into a string-result using the provided layout
(Inherited from Target.)
Protected methodRenderLogEventT(LayoutT, LogEventInfo, T)
Renders the logevent into a result-value by using the provided layout
(Inherited from Target.)
Protected methodResolveServiceT
Resolve from DI ServiceRepository
(Inherited from Target.)
Public methodToString
Returns a string that represents the current object.
(Inherited from WrapperTargetBase.)
Protected methodWrite(AsyncLogEventInfo)
Adds the specified log event to the buffer and flushes the buffer in case the buffer gets full.
(Overrides TargetWrite(AsyncLogEventInfo).)
Protected methodWrite(IListAsyncLogEventInfo)
Writes an array of logging events to the log target. By default it iterates on all events and passes them to "Write" method. Inheriting classes can use this method to optimize batch writes.
(Inherited from Target.)
Protected methodWrite(LogEventInfo)
Writes logging event to the log target. Must be overridden in inheriting classes.
(Inherited from WrapperTargetBase.)
Public methodWriteAsyncLogEvent
Writes the log to the target.
(Inherited from Target.)
Public methodWriteAsyncLogEvents(AsyncLogEventInfo)
Writes the array of log events.
(Inherited from Target.)
Public methodWriteAsyncLogEvents(IListAsyncLogEventInfo)
Writes the array of log events.
(Inherited from Target.)
Protected methodWriteAsyncThreadSafe(AsyncLogEventInfo)
Writes a log event to the log target, in a thread safe manner. Any override of this method has to provide their own synchronization mechanism. !WARNING! Custom targets should only override this method if able to provide their own synchronization mechanism. Layout-objects are not guaranteed to be thread-safe, so using them without a SyncRoot-object can be dangerous.
(Inherited from Target.)
Protected methodWriteAsyncThreadSafe(IListAsyncLogEventInfo)
Writes an array of logging events to the log target, in a thread safe manner. Any override of this method has to provide their own synchronization mechanism. !WARNING! Custom targets should only override this method if able to provide their own synchronization mechanism. Layout-objects are not guaranteed to be thread-safe, so using them without a SyncRoot-object can be dangerous.
(Inherited from Target.)
Protected methodWriteFailedNotInitialized
LogEvent is written to target, but target failed to successfully initialize
(Inherited from Target.)
Top
Remarks
See Also