Class AppenderAttachedImpl
A straightforward implementation of the IAppenderAttachable interface.
public class AppenderAttachedImpl : IAppenderAttachable
- Inheritance
-
AppenderAttachedImpl
- Implements
- Inherited Members
Remarks
This is the default implementation of the IAppenderAttachable interface. Implementors of the IAppenderAttachable interface should aggregate an instance of this type.
Constructors
AppenderAttachedImpl()
Constructor
public AppenderAttachedImpl()
Remarks
Initializes a new instance of the AppenderAttachedImpl class.
Properties
Appenders
Gets all attached appenders.
public AppenderCollection Appenders { get; }
Property Value
- AppenderCollection
A collection of attached appenders, or
nullif there are no attached appenders.
Remarks
The read only collection of all currently attached appenders.
Methods
AddAppender(IAppender)
Attaches an appender.
public void AddAppender(IAppender newAppender)
Parameters
newAppenderIAppenderThe appender to add.
Remarks
If the appender is already in the list it won't be added again.
AppendLoopOnAppenders(LoggingEvent)
Append on on all attached appenders.
public int AppendLoopOnAppenders(LoggingEvent loggingEvent)
Parameters
loggingEventLoggingEventThe event being logged.
Returns
- int
The number of appenders called.
Remarks
Calls the DoAppend(LoggingEvent) method on all attached appenders.
AppendLoopOnAppenders(LoggingEvent[])
Append on on all attached appenders.
public int AppendLoopOnAppenders(LoggingEvent[] loggingEvents)
Parameters
loggingEventsLoggingEvent[]The array of events being logged.
Returns
- int
The number of appenders called.
Remarks
Calls the DoAppend(LoggingEvent) method on all attached appenders.
GetAppender(string)
Gets an attached appender with the specified name.
public IAppender GetAppender(string name)
Parameters
namestringThe name of the appender to get.
Returns
- IAppender
The appender with the name specified, or
nullif no appender with the specified name is found.
Remarks
Lookup an attached appender by name.
RemoveAllAppenders()
Removes all attached appenders.
public void RemoveAllAppenders()
Remarks
Removes and closes all attached appenders
RemoveAppender(string)
Removes the appender with the specified name from the list of appenders.
public 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 attached appenders.
public 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.