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
LoggerLogger object whose MDLC is to be set.
name
stringOptionally, 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
LoggerLogger object whose MDLC is to be set.
numericId
ushortIdentifier of the new MDLC as a number.
name
stringOptionally, a name that will be associated with the MDLC context.
Returns
- IDisposable
IDisposable interface that should be used to release the MDLC context properties.