Class ForwardingAppender
This appender forwards logging events to attached appenders.
public class ForwardingAppender : AppenderSkeleton, IBulkAppender, IAppender, IOptionHandler, IAppenderAttachable
- Inheritance
-
ForwardingAppender
- Implements
- Inherited Members
Remarks
The forwarding appender can be used to specify different thresholds and filters for the same appender at different locations within the hierarchy.
Constructors
ForwardingAppender()
Initializes a new instance of the ForwardingAppender class.
public ForwardingAppender()
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
Remarks
If the specified IAppender is already in the list of appenders, then it won't be added again.
Append(LoggingEvent)
Forward the logging event to the attached appenders
protected override void Append(LoggingEvent loggingEvent)
Parameters
loggingEventLoggingEventThe event to log.
Remarks
Delivers the logging event to all the attached appenders.
Append(LoggingEvent[])
Forward the logging events to the attached appenders
protected override void Append(LoggingEvent[] loggingEvents)
Parameters
loggingEventsLoggingEvent[]The array of events to log.
Remarks
Delivers the logging events to all the attached appenders.
GetAppender(string)
Looks for the appender with the specified name.
public virtual IAppender GetAppender(string name)
Parameters
namestringThe name of the appender to lookup.
Returns
- IAppender
The appender with the specified name, or
null.
Remarks
Get the named appender attached to this 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
namestringThe 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
appenderIAppenderThe 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.