-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
${logger:shortName=Boolean}
- 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
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
- Articles about NLog
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json