Table of Contents

Interface IAppenderAttachable

Namespace
log4net.Core
Assembly
log4net.dll

Interface for attaching appenders to objects.

public interface IAppenderAttachable

Remarks

Interface for attaching, removing and retrieving appenders.

Properties

Appenders

Gets all attached appenders.

AppenderCollection Appenders { get; }

Property Value

AppenderCollection

A collection of attached appenders.

Remarks

Gets a collection of attached appenders. If there are no attached appenders the implementation should return an empty collection rather than null.

Methods

AddAppender(IAppender)

Attaches an appender.

void AddAppender(IAppender appender)

Parameters

appender IAppender

The appender to add.

Remarks

Add the specified appender. The implementation may choose to allow or deny duplicate appenders.

GetAppender(string)

Gets an attached appender with the specified name.

IAppender GetAppender(string name)

Parameters

name string

The name of the appender to get.

Returns

IAppender

The appender with the name specified, or null if no appender with the specified name is found.

Remarks

Returns an attached appender with the name specified. If no appender with the specified name is found null will be returned.

RemoveAllAppenders()

Removes all attached appenders.

void RemoveAllAppenders()

Remarks

Removes and closes all attached appenders

RemoveAppender(string)

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

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 attached appenders.

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.