Click or drag to resize
MappedDiagnosticsLogicalContext Class
Async version of Mapped Diagnostics Context - a logical context structure that keeps a dictionary of strings and provides methods to output them in layouts. Allows for maintaining state across asynchronous tasks and call contexts.
Inheritance Hierarchy
SystemObject
  NLogMappedDiagnosticsLogicalContext

Namespace: NLog
Assembly: NLog (in NLog.dll) Version: 4.3.0
Syntax
public static class MappedDiagnosticsLogicalContext

The MappedDiagnosticsLogicalContext type exposes the following members.

Methods
  NameDescription
Public methodStatic memberClear
Clears the content of current logical context.
Public methodStatic memberClear(Boolean)
Clears the content of current logical context.
Public methodStatic memberContains
Checks whether the specified item exists in current logical context.
Public methodStatic memberGet(String)
Gets the current logical context named item, as String.
Public methodStatic memberGet(String, IFormatProvider)
Gets the current logical context named item, as String.
Public methodStatic memberGetObject
Gets the current logical context named item, as Object.
Public methodStatic memberRemove
Removes the specified item from current logical context.
Public methodStatic memberSet(String, Object)
Sets the current logical context item to the specified value.
Public methodStatic memberSet(String, String)
Sets the current logical context item to the specified value.
Top
Remarks
Ideally, these changes should be incorporated as a new version of the MappedDiagnosticsContext class in the original NLog library so that state can be maintained for multiple threads in asynchronous situations.
See Also