BufferingAppenderSkeleton Class | Apache log4net™ SDK Documentation

Abstract base class implementation of IAppender that buffers events in a fixed size buffer.
Inheritance Hierarchy

System
Object
log4net.Appender
AppenderSkeleton
log4net.Appender
BufferingAppenderSkeleton
log4net.Appender
AdoNetAppender
log4net.Appender
BufferingForwardingAppender
log4net.Appender
RemotingAppender
log4net.Appender
SmtpAppender
log4net.Appender
SmtpPickupDirAppender

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public abstract class BufferingAppenderSkeleton : AppenderSkeleton

    Public MustInherit Class BufferingAppenderSkeleton
    	Inherits AppenderSkeleton

    public ref class BufferingAppenderSkeleton abstract : public AppenderSkeleton

    [<AbstractClassAttribute>]
    type BufferingAppenderSkeleton =
        class
            inherit AppenderSkeleton
        end

The BufferingAppenderSkeleton type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| BufferingAppenderSkeleton | Initializes a new instance of the BufferingAppenderSkeleton class.
| BufferingAppenderSkeleton(Boolean) | Initializes a new instance of the BufferingAppenderSkeleton class.

Top
Properties

| Name | Description
--- | --- | ---
| BufferSize | Gets or sets the size of the cyclic buffer used to hold the logging events.
| ErrorHandler | Gets or sets the IErrorHandler for this appender. (Inherited from AppenderSkeleton.)
| Evaluator | Gets or sets the ITriggeringEventEvaluator that causes the buffer to be sent immediately.
| FilterHead | The filter chain. (Inherited from AppenderSkeleton.)
| Fix | Gets or sets a the fields that will be fixed in the event
| Layout | Gets or sets the ILayout for this appender. (Inherited from AppenderSkeleton.)
| Lossy | Gets or sets a value that indicates whether the appender is lossy.
| LossyEvaluator | Gets or sets the value of the ITriggeringEventEvaluator to use.
| Name | Gets or sets the name of this appender. (Inherited from AppenderSkeleton.)
| OnlyFixPartialEventData | Obsolete. Gets or sets a value indicating if only part of the logging event data should be fixed.
| RequiresLayout | Tests if this appender requires a Layout to be set. (Inherited from AppenderSkeleton.)
| Threshold | Gets or sets the threshold Level of this appender. (Inherited from AppenderSkeleton.)

Top
Methods

| Name | Description
--- | --- | ---
| ActivateOptions | Initialize the appender based on the options set (Overrides AppenderSkeleton ActivateOptions .)
| AddFilter | Adds a filter to the end of the filter chain. (Inherited from AppenderSkeleton.)
| Append( LoggingEvent ) | Append a bulk array of logging events. (Inherited from AppenderSkeleton.)
| Append(LoggingEvent) | This method is called by the DoAppend(LoggingEvent) method. (Overrides AppenderSkeleton Append(LoggingEvent).)
| ClearFilters | Clears the filter list for this appender. (Inherited from AppenderSkeleton.)
| Close | Closes the appender and release resources. (Inherited from AppenderSkeleton.)
| DoAppend(LoggingEvent) | Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific [M:Append(LoggingEvent)] method. (Inherited from AppenderSkeleton.)
| DoAppend( LoggingEvent ) | Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific [M:Append(LoggingEvent[])] method. (Inherited from AppenderSkeleton.)
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
| FilterEvent | Test if the logging event should we output by this appender (Inherited from AppenderSkeleton.)
| Finalize | Finalizes this appender by calling the implementation's Close method. (Inherited from AppenderSkeleton.)
| Flush | Flush the currently buffered events
| Flush(Boolean) | Flush the currently buffered events
| Flush(Int32) | Flushes any buffered log data. (Overrides AppenderSkeleton Flush(Int32).)
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
| GetType | Gets the Type of the current instance. (Inherited from Object.)
| IsAsSevereAsThreshold | Checks if the message level is below this appender's threshold. (Inherited from AppenderSkeleton.)
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.)
| OnClose | Close this appender instance. (Overrides AppenderSkeleton OnClose .)
| PreAppendCheck | Called before [M:Append(LoggingEvent)] as a precondition. (Inherited from AppenderSkeleton.)
| RenderLoggingEvent(LoggingEvent) | Renders the LoggingEvent to a string. (Inherited from AppenderSkeleton.)
| RenderLoggingEvent(TextWriter, LoggingEvent) | Renders the LoggingEvent to a string. (Inherited from AppenderSkeleton.)
| SendBuffer | Sends the events.
| SendFromBuffer | Sends the contents of the buffer.
| ToString | Returns a String that represents the current Object. (Inherited from Object.)

Top
Remarks

This base class should be used by appenders that need to buffer a number of events before logging them. For example the AdoNetAppender buffers events and then submits the entire contents of the buffer to the underlying database in one go.

Subclasses should override the [M:SendBuffer(LoggingEvent[])] method to deliver the buffered events.

The BufferingAppenderSkeleton maintains a fixed size cyclic buffer of events. The size of the buffer is set using the BufferSize property.

A ITriggeringEventEvaluator is used to inspect each event as it arrives in the appender. If the Evaluator triggers, then the current buffer is sent immediately (see [M:SendBuffer(LoggingEvent[])]). Otherwise the event is stored in the buffer. For example, an evaluator can be used to deliver the events immediately when an ERROR event arrives.

The buffering appender can be configured in a Lossy mode. By default the appender is NOT lossy. When the buffer is full all the buffered events are sent with [M:SendBuffer(LoggingEvent[])]. If the Lossy property is set to true then the buffer will not be sent when it is full, and new events arriving in the appender will overwrite the oldest event in the buffer. In lossy mode the buffer will only be sent when the Evaluator triggers. This can be useful behavior when you need to know about ERROR events but not about events with a lower level, configure an evaluator that will trigger when an ERROR event arrives, the whole buffer will be sent which gives a history of events leading up to the ERROR event.

See Also

#### Reference

log4net.Appender Namespace