Table of Contents

Class BufferingForwardingAppender

Namespace
log4net.Appender
Assembly
log4net.dll

Buffers events and then forwards them to attached appenders.

public class BufferingForwardingAppender : BufferingAppenderSkeleton, IBulkAppender, IAppender, IOptionHandler, IAppenderAttachable
Inheritance
BufferingForwardingAppender
Implements
Inherited Members

Remarks

The events are buffered in this appender until conditions are met to allow the appender to deliver the events to the attached appenders. See BufferingAppenderSkeleton for the conditions that cause the buffer to be sent.

The forwarding appender can be used to specify different thresholds and filters for the same appender at different locations within the hierarchy.

Constructors

BufferingForwardingAppender()

Initializes a new instance of the BufferingForwardingAppender class.

public BufferingForwardingAppender()

Remarks

Default constructor.

Properties

Appenders

Gets the appenders contained in this appender as an ICollection.

public virtual AppenderCollection Appenders { get; }

Property Value

AppenderCollection

A collection of the appenders in this appender.

Remarks

If no appenders can be found, then an EmptyCollection is returned.

Methods

AddAppender(IAppender)

Adds an IAppender to the list of appenders of this instance.

public virtual void AddAppender(IAppender newAppender)

Parameters

newAppender IAppender

The IAppender to add to this appender.

Remarks

If the specified IAppender is already in the list of appenders, then it won't be added again.

GetAppender(string)

Looks for the appender with the specified name.

public virtual IAppender GetAppender(string name)

Parameters

name string

The name of the appender to lookup.

Returns

IAppender

The appender with the specified name, or null.

Remarks

Get the named appender attached to this buffering appender.

OnClose()

Closes the appender and releases resources.

protected override void OnClose()

Remarks

Releases any resources allocated within the appender such as file handles, network connections, etc.

It is a programming error to append to a closed appender.

RemoveAllAppenders()

Removes all previously added appenders from this appender.

public virtual void RemoveAllAppenders()

Remarks

This is useful when re-reading configuration information.

RemoveAppender(string)

Removes the appender with the specified name from the list of appenders.

public virtual IAppender RemoveAppender(string name)

Parameters

name string

The name of the appender to remove.

Returns

IAppender

The appender removed from the list

Remarks

The appender removed is not closed. If you are discarding the appender you must call Close() on the appender removed.

RemoveAppender(IAppender)

Removes the specified appender from the list of appenders.

public virtual IAppender RemoveAppender(IAppender appender)

Parameters

appender IAppender

The appender to remove.

Returns

IAppender

The appender removed from the list

Remarks

The appender removed is not closed. If you are discarding the appender you must call Close() on the appender removed.

SendBuffer(LoggingEvent[])

Send the events.

protected override void SendBuffer(LoggingEvent[] events)

Parameters

events LoggingEvent[]

The events that need to be send.

Remarks

Forwards the events to the attached appenders.