BasicConfigurator Class | Apache log4net™ SDK Documentation

Use this class to quickly configure a Hierarchy.
Inheritance Hierarchy

System
Object
log4net.Config
BasicConfigurator

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

C#
VB
C++
F#
Copy

    public sealed class BasicConfigurator

    Public NotInheritable Class BasicConfigurator

    public ref class BasicConfigurator sealed

    [<SealedAttribute>]
    type BasicConfigurator =  class end

The BasicConfigurator type exposes the following members.

Methods

| Name | Description
--- | --- | ---
| Configure | Initializes the log4net system with a default configuration.
| Configure(IAppender) | Initializes the log4net system using the specified appender.
| Configure( IAppender ) | Initializes the log4net system using the specified appenders.
| Configure(ILoggerRepository) | Initializes the ILoggerRepository with a default configuration.
| Configure(ILoggerRepository, IAppender) | Initializes the ILoggerRepository using the specified appender.
| Configure(ILoggerRepository, IAppender ) | Initializes the ILoggerRepository using the specified appenders.
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
| GetType | Gets the Type of the current instance. (Inherited from Object.)
| ToString | Returns a String that represents the current Object. (Inherited from Object.)

Top
Remarks

Allows very simple programmatic configuration of log4net.

Only one appender can be configured using this configurator. The appender is set at the root of the hierarchy and all logging events will be delivered to that appender.

Appenders can also implement the IOptionHandler interface. Therefore they would require that the [M:log4net.Core.IOptionHandler.ActivateOptions()] method be called after the appenders properties have been configured.

See Also

#### Reference

log4net.Config Namespace