Click or drag to resize

MappedDiagnosticsContext Class

Note: This API is now obsolete.

Obsolete and replaced by ScopeContext with NLog v5. Mapped Diagnostics Context (MDC) is a dictionary of keys and values. Stores the dictionary in the thread-local static variable, and provides methods to output dictionary values in layouts.
Inheritance Hierarchy
SystemObject
  NLogMappedDiagnosticsContext

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 MappedDiagnosticsContext

The MappedDiagnosticsContext type exposes the following members.

Methods
  NameDescription
Public methodStatic memberClear Obsolete.
Clears the content of current thread MDC.
Public methodStatic memberContains Obsolete.
Checks whether the specified item exists in current thread MDC.
Public methodStatic memberGet(String) Obsolete.
Gets the current thread MDC named item, as String.
Public methodStatic memberGet(String, IFormatProvider) Obsolete.
Gets the current thread MDC named item, as String.
Public methodStatic memberGetNames Obsolete.
Returns all item names
Public methodStatic memberGetObject Obsolete.
Gets the current thread MDC named item, as Object.
Public methodStatic memberRemove Obsolete.
Removes the specified item from current thread MDC.
Public methodStatic memberSet(String, Object) Obsolete.
Sets the current thread MDC item to the specified value.
Public methodStatic memberSet(String, String) Obsolete.
Sets the current thread MDC item to the specified value.
Public methodStatic memberSetScoped(String, Object) Obsolete.
Sets the current thread MDC item to the specified value.
Public methodStatic memberSetScoped(String, String) Obsolete.
Sets the current thread MDC item to the specified value.
Top
See Also