LAUREL BRIDGE

DCF33StyleNLogAdapter Class

DICOM Connectivity Framework V3.4
Adapter class to support using NLog as the back end log facility, and configured to use DCF33 style headers.
Inheritance Hierarchy

SystemObject
  LaurelBridge.DCFExamples.LoggingDCF33StyleDCF33StyleNLogAdapter

Namespace:  LaurelBridge.DCFExamples.LoggingDCF33Style
Assembly:  LoggingDCF33Style (in LoggingDCF33Style.exe) Version: DCF34 r13043 DCF_3_4_56_20220408 NetFramework
Syntax

C#
public sealed class DCF33StyleNLogAdapter : IDisposable

The DCF33StyleNLogAdapter type exposes the following members.

Constructors

  NameDescription
Public methodDCF33StyleNLogAdapter
Construct an NLog adapter with DCF33 style headers.
Top
Properties

  NameDescription
Public propertyFormatProvider
Get/Set the format provider to use when logging messages to nlog.
Top
Methods

  NameDescription
Public methodDebug
Log a debug level message to the logging backend.
Public methodDebugFormat
Log a debug level message to the logging backend.
Public methodDispose
Flush any pending buffered log messages and cleanup logger resources.
Public methodError
Log an error level message to the logging backend.
Public methodErrorFormat
Log an error level message to the logging backend.
Public methodFatal
Log a fatal level message to the logging backend.
Public methodFatalFormat
Log a fatal level message to the logging backend.
Public methodFlush
Flush any pending buffered log messages. The implementation of this method is defined by the LogAdapter.
Public methodInfo
Log an info level message to the logging backend.
Public methodInfoFormat
Log an info level message to the logging backend.
Public methodVerbose
Log a verbose level message to the logging backend.
Public methodVerboseFormat
Log a verbose level message to the logging backend.
Public methodWarn
Log a warn level message to the logging backend.
Public methodWarnFormat
Log a warn level message to the logging backend.
Top
Remarks

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.

See Also

Reference