Table of Contents

Method SetMdlc

Namespace
WhalesSecret.TradeScriptLib.Logging
Assembly
WhalesSecret.TradeScriptLib.dll

SetMdlc(Logger, string?)

Sets a unique NLog Mapped Diagnostics Logical Context to the current execution context. This method is to be called at the start of each async context that we want to track separately.

public static IDisposable SetMdlc(this Logger logger, string? name = null)

Parameters

logger Logger

Logger object whose MDLC is to be set.

name string

Optionally, a name that will be associated with the MDLC context.

Returns

IDisposable

IDisposable interface that should be used to release the MDLC context properties.

SetMdlc(Logger, ushort, string?)

Sets a unique NLog Mapped Diagnostics Logical Context to the current execution context. This method is to be called at the start of each async context that we want to track separately.

public static IDisposable SetMdlc(this Logger logger, ushort numericId, string? name = null)

Parameters

logger Logger

Logger object whose MDLC is to be set.

numericId ushort

Identifier of the new MDLC as a number.

name string

Optionally, a name that will be associated with the MDLC context.

Returns

IDisposable

IDisposable interface that should be used to release the MDLC context properties.