log4net SDK Reference

Level Class

Defines the default set of levels recognized by the system.

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

System.Object
   log4net.Core.Level

[Visual Basic]
NotInheritable Public Class Level
    Implements IComparable
[C#]
public sealed class Level : IComparable

Thread Safety

This type is not safe for multithreaded operations.

Remarks

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:

Requirements

Namespace: log4net.Core

Assembly: log4net (in log4net.dll)

See Also

Level Members | log4net.Core Namespace