<PackageReference Include="NLog" Version="6.0.7" />

NLog.MappedDiagnosticsContext

public static class MappedDiagnosticsContext
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.
public static void Clear()

Clears the content of current thread MDC.

public static bool Contains(string item)

Checks whether the specified item exists in current thread MDC.

public static string Get(string item)

Gets the current thread MDC named item, as String.

public static string Get(string item, IFormatProvider formatProvider)

Gets the current thread MDC named item, as String.

public static ICollection<string> GetNames()

Returns all item names

public static object GetObject(string item)

Gets the current thread MDC named item, as Object.

public static void Remove(string item)

Removes the specified item from current thread MDC.

public static void Set(string item, string value)

Sets the current thread MDC item to the specified value.

public static void Set(string item, object value)

Sets the current thread MDC item to the specified value.

public static IDisposable SetScoped(string item, string value)

Sets the current thread MDC item to the specified value.

public static IDisposable SetScoped(string item, object value)

Sets the current thread MDC item to the specified value.