NLog by Kim Christensen, Julian Verdurmen

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

 NDC

public static class NDC
Nested Diagnostics Context - for log4net compatibility.
public static string TopMessage { get; }

Gets the top NDC message but doesn't remove it.

public static object TopObject { get; }

Gets the top NDC object but doesn't remove it.

public static void Clear()

Clears current thread NDC stack.

public static string[] GetAllMessages()

Gets all messages on the stack.

public static object[] GetAllObjects()

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

public static string Pop()

Pops the top message off the NDC stack.

public static object PopObject()

Pops the top object off the NDC stack. The object is removed from the stack.

public static IDisposable Push(string text)

Pushes the specified text on current thread NDC.