Click or drag to resize

MappedDiagnosticsContextSetScoped Method (String, Object)

Note: This API is now obsolete.

Sets the current thread MDC item to the specified value.

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 IDisposable SetScoped(
	string item,
	Object value
)

Parameters

item
Type: SystemString
Item name.
value
Type: SystemObject
Item value.

Return Value

Type: IDisposable
>An IDisposable that can be used to remove the item from the current thread MDC.
See Also