NLogLogger class¶
Attributes: [DebuggerDisplay("Name={_logger.Name} Level={Level}")]
Defined in
Namespace: Splat.NLog
Assembly: Splat.NLog.dll
Full name: Splat.NLog.NLogLogger
Modifiers: public sealed
Summary¶
The typed-argument overloads, kept apart from the rest of the type because the set is dictated by the logging contract: one overload per argument count, each forwarding the arguments on without boxing them.
Applies to
net10.0, net9.0, net8.0, net462, net481
Class hierarchy
classDiagram
class NLogLogger
class IFullLogger {
<>
}
IFullLogger <|.. NLogLogger
class IAllocationFreeLogger {
<>
}
IAllocationFreeLogger <|.. NLogLogger
class IAllocationFreeErrorLogger {
<>
}
IAllocationFreeErrorLogger <|.. NLogLogger
class ILogger {
<>
}
ILogger <|.. NLogLogger
class IDisposable {
<>
}
IDisposable <|.. NLogLogger
Implements: IFullLogger, IAllocationFreeLogger, IAllocationFreeErrorLogger, ILogger, IDisposable
Remarks¶
This class acts as an adapter, allowing code that depends on IFullLogger to log messages through NLog. It supports all standard log levels and message formats, and automatically tracks changes to the underlying NLog logger's configuration. Instances of NLogLogger are not thread-affine and can be used concurrently from multiple threads. Disposing the logger detaches internal event handlers but does not dispose the underlying NLog logger.
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [NLogLogger](# class. |
Properties¶
| Name | Summary |
|---|---|
| Level | Gets the level at which the target will emit messages. |
| IsDebugEnabled | Gets a value indicating whether the logger currently emits debug logs. |
| IsInfoEnabled | Gets a value indicating whether the logger currently emits information logs. |
| IsWarnEnabled | Gets a value indicating whether the logger currently emits warning logs. |
| IsErrorEnabled | Gets a value indicating whether the logger currently emits error logs. |
| IsFatalEnabled | Gets a value indicating whether the logger currently emits fatal logs. |
Methods¶
| Name | Summary |
|---|---|
| Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
| Write | Writes a message to the target. |
| Debug | Emits a debug log message. This will emit the public contents of the object provided to the log. |
| DebugException | Emits a debug log message. This will emit details about a exception. This type of logging is not able to be localized. |
| Info | Emits a info log message. This will emit the public contents of the object provided to the log. |
| InfoException | Emits a info log message. This will emit details about a exception. This type of logging is not able to be localized. |
| Warn | Emits a warning log message. This will emit the public contents of the object provided to the log. |
| WarnException | Emits a warning log message. This will emit details about a exception. This type of logging is not able to be localized. |
| Error | Emits a error log message. This will emit the public contents of the object provided to the log. |
| ErrorException | Emits a error log message. This will emit details about a exception. This type of logging is not able to be localized. |
| Fatal | Emits a fatal log message. This will emit the public contents of the object provided to the log. |
| FatalException | Emits a fatal log message. This will emit details about a exception. This type of logging is not able to be localized. |