-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Message Layout Renderer
Rolf Kristensen edited this page Oct 1, 2023
·
13 revisions
The formatted log message.
Platforms Supported: All
${message:exceptionSeparator=String:withException=Boolean:raw=Boolean}
- exceptionSeparator - String that separates message from the exception.
- withException - Indicates whether to log exception along with message. Boolean
-
raw - Render the unformatted input message without using input parameters (Message-Template for structured logging). Boolean
Introduced with NLog 4.5
NLog provides several text transformations, that can be useful. Ex:
-
Truncate -
${message:truncate=1000}
-
Replace Newlines -
${replace-newlines:${message}}
-
Replace with RegEx support -
${replace:${message}:searchFor=abc:replaceWith=xyz}
- 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