Click or drag to resize

LogLevel Class

Defines available log levels.
Inheritance Hierarchy
SystemObject
  NLogLogLevel

Namespace:  NLog
Assembly:  NLog (in NLog.dll) Version: 5.3.1+cf6675da40ccfd4c8c526a3b2bdbeed3442910a1
Syntax
[TypeConverterAttribute(typeof(LogLevelTypeConverter))]
public sealed class LogLevel : IComparable<LogLevel>, 
	IComparable, IEquatable<LogLevel>, IFormattable

The LogLevel type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberAllLevels
Gets all the available log levels (Trace, Debug, Info, Warn, Error, Fatal, Off).
Public propertyStatic memberAllLoggingLevels
Gets all the log levels that can be used to log events (Trace, Debug, Info, Warn, Error, Fatal) i.e LogLevel.Off is excluded.
Public propertyName
Gets the name of the log level.
Public propertyOrdinal
Gets the ordinal of the log level.
Top
Methods
  NameDescription
Public methodCompareTo(LogLevel)
Compares the level to the other LogLevel object.
Public methodCompareTo(Object)
Compares the level to the other LogLevel object.
Public methodEquals(LogLevel)
Determines whether the specified LogLevel instance is equal to this instance.
Public methodEquals(Object)
Determines whether the specified object is equal to the current object.
(Overrides ObjectEquals(Object).)
Public methodStatic memberFromOrdinal
Gets the LogLevel that corresponds to the specified ordinal.
Public methodStatic memberFromString
Returns the LogLevel that corresponds to the supplied string.
Public methodGetHashCode
Serves as the default hash function.
(Overrides ObjectGetHashCode.)
Public methodToString
Returns a string representation of the log level.
(Overrides ObjectToString.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Compares two LogLevel objects and returns a value indicating whether the first one is equal to the second one.
Public operatorStatic memberGreaterThan
Compares two LogLevel objects and returns a value indicating whether the first one is greater than the second one.
Public operatorStatic memberGreaterThanOrEqual
Compares two LogLevel objects and returns a value indicating whether the first one is greater than or equal to the second one.
Public operatorStatic memberInequality
Compares two LogLevel objects and returns a value indicating whether the first one is not equal to the second one.
Public operatorStatic memberLessThan
Compares two LogLevel objects and returns a value indicating whether the first one is less than the second one.
Public operatorStatic memberLessThanOrEqual
Compares two LogLevel objects and returns a value indicating whether the first one is less than or equal to the second one.
Top
Fields
  NameDescription
Public fieldStatic memberDebug
Debug log level (Ordinal = 1)
Public fieldStatic memberError
Error log level (Ordinal = 4)
Public fieldStatic memberFatal
Fatal log level (Ordinal = 5)
Public fieldStatic memberInfo
Info log level (Ordinal = 2)
Public fieldStatic memberOff
Off log level (Ordinal = 6)
Public fieldStatic memberTrace
Trace log level (Ordinal = 0)
Public fieldStatic memberWarn
Warn log level (Ordinal = 3)
Top
Remarks
Log levels ordered by severity:
- Trace (Ordinal = 0) : Most verbose level. Used for development and seldom enabled in production.
- Debug (Ordinal = 1) : Debugging the application behavior from internal events of interest.
- Info (Ordinal = 2) : Information that highlights progress or application lifetime events.
- Warn (Ordinal = 3) : Warnings about validation issues or temporary failures that can be recovered.
- Error (Ordinal = 4) : Errors where functionality has failed or Exception have been caught.
- Fatal (Ordinal = 5) : Most critical level. Application is about to abort.
See Also