Callsite line number layout renderer - NLog/NLog GitHub Wiki

The call site source-code line-number. For full callsite use ${callsite}

Platforms Supported: Limited (Not supported on NetStandard 1.3)

Introduced in NLog v4.1

Configuration Syntax

${callsite-linenumber:skipFrames=Integer}

Parameters

Rendering Options

  • skipFrames - The number of frames to skip. Integer Default: 0
  • captureStackTrace - Logger should capture StackTrace, if it was not provided manually. Default: true

    Introduced with NLog 4.7.1

Notes

Please also note that this infers heavy performance hit when doing lots of logging, as it has to capture full StackTrace for every log message.

If symbol symbol information is not available, then it will only output source-code line-number 0. Symbol information from PDB files must be deployed with the application to retrieve and output source-code line-number. For applications compiled in release mode, then inlining can occur and cause "unexpected" line-numbers.