Skip to content

ObjectPath Layout Renderer

Ben Johnson edited this page Nov 11, 2019 · 4 revisions

Render a property of an object.

Introducted in NLog 4.6.7

Platforms Supported: All

Configuration Syntax

${object-path:${exception}:path=String:Format=String:Culture=String}
${exception:objectpath=String} // Ambient way

Parameters

Rendering Options

  • objectpath - Path to the property. Nested properties are supported. Arrays aren't supported.
  • format - Format when rendering.
  • culture - Culture code used for formatting.

Example

Assume we catch new ExternalException("Exception with errorCode", 5000)

${exception:objectpath=HResult} // results in 5000
${object-path:${exception}:path=HResult:Culture=NL-nl:format=N2}"; // results in 5.000,00
Clone this wiki locally