A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/NLog/NLog/wiki/ScopeIndent-Layout-Renderer below:

ScopeIndent Layout Renderer · NLog/NLog Wiki · GitHub

ScopeContext Nested States are stored in the thread execution context. Similar to "Nested Diagnostic Context" (NDC) in Log4j.

Platforms Supported: All (AsyncLocal is used for NetStandard and Net46, but older platforms uses Remoting.Messaging.CallContext)

Introduced with NLog 5.0.5

Inserts indent-delimiter for every nested state in the ScopeContext.

${scopeindent:indent=Layout}
Logger.Info("Hello No Scope");              // Will not be indented

using (NLog.ScopeContext.PushNestedState("First Scope"))
{
   Logger.Info("Hello First Scope");        // Will be indented once
   await InnerOperationAsync();
}

static async Task InnerOperationAsync()
{
    using (NLog.ScopeContext.PushNestedState("Second Scope"))
    {
        Logger.Info("Hello Second Scope");   // Will be indented twice
        await Task.Yield();
    }
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4