Level ClassApache log4net™ SDK Documentation
Defines the default set of levels recognized by the system.
Inheritance Hierarchy

SystemObject
  log4net.CoreLevel

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

[SerializableAttribute]
public sealed class Level : IComparable

The Level type exposes the following members.

Constructors

  NameDescription
Public methodLevel(Int32, String)
Constructor
Public methodLevel(Int32, String, String)
Constructor
Top
Properties

  NameDescription
Public propertyDisplayName
Gets the display name of this level.
Public propertyName
Gets the name of this level.
Public propertyValue
Gets the value of this level.
Top
Methods

  NameDescription
Public methodStatic memberCompare
Compares two specified Level instances.
Public methodCompareTo
Compares this instance to a specified object and returns an indication of their relative values.
Public methodEquals
Compares levels.
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
Returns a hash code
(Overrides ObjectGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns the String representation of the current Level.
(Overrides ObjectToString.)
Top
Operators

  NameDescription
Public operatorStatic memberEquality
Returns a value indicating whether two specified Level objects have the same value.
Public operatorStatic memberGreaterThan
Returns a value indicating whether a specified Level is greater than another specified Level.
Public operatorStatic memberGreaterThanOrEqual
Returns a value indicating whether a specified Level is greater than or equal to another specified Level.
Public operatorStatic memberInequality
Returns a value indicating whether two specified Level objects have different values.
Public operatorStatic memberLessThan
Returns a value indicating whether a specified Level is less than another specified Level.
Public operatorStatic memberLessThanOrEqual
Returns a value indicating whether a specified Level is less than or equal to another specified Level.
Top
Fields

  NameDescription
Public fieldStatic memberAlert
The Alert level designates very severe error events. Take immediate action, alerts.
Public fieldStatic memberAll
The All level designates the lowest level possible.
Public fieldStatic memberCritical
The Critical level designates very severe error events. Critical condition, critical.
Public fieldStatic memberDebug
The Debug level designates fine-grained informational events that are most useful to debug an application.
Public fieldStatic memberEmergency
The Emergency level designates very severe error events. System unusable, emergencies.
Public fieldStatic memberError
The Error level designates error events that might still allow the application to continue running.
Public fieldStatic memberFatal
The Fatal level designates very severe error events that will presumably lead the application to abort.
Public fieldStatic memberFine
The Fine level designates fine-grained informational events that are most useful to debug an application.
Public fieldStatic memberFiner
The Finer level designates fine-grained informational events that are most useful to debug an application.
Public fieldStatic memberFinest
The Finest level designates fine-grained informational events that are most useful to debug an application.
Public fieldStatic memberInfo
The Info level designates informational messages that highlight the progress of the application at coarse-grained level.
Public fieldStatic memberLog4Net_Debug
The Emergency level designates very severe error events. System unusable, emergencies.
Public fieldStatic memberNotice
The Notice level designates informational messages that highlight the progress of the application at the highest level.
Public fieldStatic memberOff
The Off level designates a higher level than all the rest.
Public fieldStatic memberSevere
The Severe level designates very severe error events.
Public fieldStatic memberTrace
The Trace level designates fine-grained informational events that are most useful to debug an application.
Public fieldStatic memberVerbose
The Verbose level designates fine-grained informational events that are most useful to debug an application.
Public fieldStatic memberWarn
The Warn level designates potentially harmful situations.
Top
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:

See Also

Reference