LaurelBridge.DCFExamples.LoggingDCF33StyleDCF33StyleNLogAdapter
Namespace: LaurelBridge.DCFExamples.LoggingDCF33Style
Assembly: LoggingDCF33Style (in LoggingDCF33Style.exe) Version: DCF34 r13043 DCF_3_4_56_20220408 NetFramework
public sealed class DCF33StyleNLogAdapter : IDisposable
The DCF33StyleNLogAdapter type exposes the following members.
Name | Description | |
---|---|---|
DCF33StyleNLogAdapter |
Construct an NLog adapter with DCF33 style headers.
|
Name | Description | |
---|---|---|
FormatProvider |
Get/Set the format provider to use when logging messages to nlog.
|
Name | Description | |
---|---|---|
Debug |
Log a debug level message to the logging backend.
| |
DebugFormat |
Log a debug level message to the logging backend.
| |
Dispose |
Flush any pending buffered log messages and cleanup logger resources.
| |
Error |
Log an error level message to the logging backend.
| |
ErrorFormat |
Log an error level message to the logging backend.
| |
Fatal |
Log a fatal level message to the logging backend.
| |
FatalFormat |
Log a fatal level message to the logging backend.
| |
Flush |
Flush any pending buffered log messages. The implementation of this method is defined by the LogAdapter.
| |
Info |
Log an info level message to the logging backend.
| |
InfoFormat |
Log an info level message to the logging backend.
| |
Verbose |
Log a verbose level message to the logging backend.
| |
VerboseFormat |
Log a verbose level message to the logging backend.
| |
Warn |
Log a warn level message to the logging backend.
| |
WarnFormat |
Log a warn level message to the logging backend.
|
The logging configuration is programmatically configured in the adapter constructor. This adapter creates a single NLog.Logger for all log messages fielded from the DCF library.
Each DCF ILogger call passes a LogEvent that contains the log message, arguments, exception, and session information. This adapter takes the information in the DCF LogEvent and converts it to an NLog LogEventInfo. This allows the properties in the DCF LogEvent to be accessible as variables in the NLog configuration.
The NLog binaries for this example were downloaded from: http://nlog-project.org.
This adapter class was written using NLog v4.1.2.