Click or drag to resize

MappedDiagnosticsLogicalContext Class

Note: This API is now obsolete.

Obsolete and replaced by ScopeContext with NLog v5. Mapped Diagnostics Logical Context (MDLC) is a dictionary of keys and values. Stores the dictionary in the logical thread callcontext, and provides methods to output dictionary values in layouts. Allows for maintaining state across asynchronous tasks and call contexts.
Inheritance Hierarchy
SystemObject
  NLogMappedDiagnosticsLogicalContext

Namespace:  NLog
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
[ObsoleteAttribute("Replaced by ScopeContext.PushProperty or Logger.PushScopeProperty using ${scopeproperty}. Marked obsolete on NLog 5.0")]
public static class MappedDiagnosticsLogicalContext

The MappedDiagnosticsLogicalContext type exposes the following members.

Methods
  NameDescription
Public methodStatic memberClear Obsolete.
Clears the content of current logical context.
Public methodStatic memberClear(Boolean) Obsolete.
Clears the content of current logical context.
Public methodStatic memberContains Obsolete.
Checks whether the specified item exists in current logical context.
Public methodStatic memberGet(String) Obsolete.
Gets the current logical context named item, as String.
Public methodStatic memberGet(String, IFormatProvider) Obsolete.
Gets the current logical context named item, as String.
Public methodStatic memberGetNames Obsolete.
Returns all item names
Public methodStatic memberGetObject Obsolete.
Gets the current logical context named item, as Object.
Public methodStatic memberRemove Obsolete.
Removes the specified item from current logical context.
Public methodStatic memberSet(String, Object) Obsolete.
Sets the current logical context item to the specified value.
Public methodStatic memberSet(String, String) Obsolete.
Sets the current logical context item to the specified value.
Public methodStatic memberSetT(String, T) Obsolete.
Sets the current logical context item to the specified value.
Public methodStatic memberSetScoped(IReadOnlyListKeyValuePairString, Object) Obsolete.
Updates the current logical context with multiple items in single operation
Public methodStatic memberSetScoped(String, Object) Obsolete.
Sets the current logical context item to the specified value.
Public methodStatic memberSetScoped(String, String) Obsolete.
Sets the current logical context item to the specified value.
Public methodStatic memberSetScopedT(String, T) Obsolete.
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