Apache log4net� SDK Documentation - Microsoft .NET Framework 4.0

Level Class

Defines the default set of levels recognized by the system.

For a list of all members of this type, see Level Members.


public�sealed�class�Level : IComparable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


Each LoggingEvent has an associated Level.

Levels have a numeric Value that defines the relative ordering between levels. Two Levels with the same Value are deemed to be equivalent.

The levels that are recognized by log4net are set for each ILoggerRepository and each repository can have different levels defined. The levels are stored in the LevelMap on the repository. Levels are looked up by name from the LevelMap.

When logging at level INFO the actual level used is not Info but the value of LoggerRepository.LevelMap["INFO"]. The default value for this is Info, but this can be changed by reconfiguring the level map.

Each level has a DisplayName in addition to its Name. The DisplayName is the string that is written into the output log. By default the display name is the same as the level name, but this can be used to alias levels or to localize the log output.

Some of the predefined levels recognized by the system are:


Namespace: log4net.Core

Assembly: log4net (in log4net.dll)

See Also

Level Members | log4net.Core Namespace