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

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

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