Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Logger Layout Renderer

Rolf Kristensen edited this page Mar 31, 2024 · 10 revisions

Renders name of the Logger that produced the LogEvent. The Logger name is assigned when it is created using NLog.LogManager.GetLogger("myLoggerName") or NLog.LogManger.GetCurrentClassLogger() (capture class-type-name as Logger-name)

The Logger-name is often used to describe the source-location where the LogEvent was produced. The NLog Logging-Rules are optimized for doing filtering / redirection of LogEvents based on the Logger-name. It is not recommended to generate Logger-name from Guid or Timestamp, as it can lead to memory-leak with huge Logger-cache.

Platforms Supported: All

Configuration Syntax

${logger:shortName=Boolean}

Parameters

Rendering Options

  • shortName - Indicates whether to render short logger name (the part after the last trailing dot character). Boolean Default: False
  • prefixName - Indicates whether to render prefix-part of logger name (the part before the last trailing dot character). Boolean Default: False

    Introduced with NLog v5.3

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.