Skip to content
Rolf Kristensen edited this page May 7, 2022 · 73 revisions

Layout renderers are template macros that are used in Layouts, e.g. ${message}, ${level} etc

Layout Renderers

All layout renderers could be found here: https://nlog-project.org/config/?tab=layout-renderers

NLog supports creating custom layout renderers. For more information, see: Extending NLog

Passing Custom Values to a Layout

Even though the layout renderers provide many pre-defined values, you may need to pass application specific values to your Layouts. You can provide own Context state, that can then be rendered by differents Layouts. For example by using LogEvent Properties, that can be rendered using using the ${event-properties} renderer.

Clone this wiki locally