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

NLog.NestedDiagnosticsLogicalContext

public static class NestedDiagnosticsLogicalContext
Obsolete and replaced by ScopeContext with NLog v5. Nested Diagnostics Logical Context (NDLC) is a stack of nested values. Stores the stack in the logical thread callcontexte, and provides methods to output the values in layouts.
public static void Clear()

Clears current stack.

public static string[] GetAllMessages()

Gets all messages on the stack.

public static string[] GetAllMessages(IFormatProvider formatProvider)

Gets all messages from the stack, without removing them.

public static object[] GetAllObjects()

Gets all objects on the stack. The objects are not removed from the stack.

public static object PeekObject()

Peeks the top object on the current NDLC stack

public static object Pop()

Pops the top message off the NDLC stack.

public static string Pop(IFormatProvider formatProvider)

Pops the top message from the NDLC stack.

public static object PopObject()

Pops the top message off the current NDLC stack

public static IDisposable Push<T>(T value)

Pushes the specified value on current stack

public static IDisposable PushObject(object value)

Pushes the specified value on current stack