Skip to content

OnHasProperties Layout Renderer

Rolf Kristensen edited this page Oct 25, 2022 · 3 revisions

Only outputs the inner layout when event properties from structured logging are included with the logevent.

Platforms Supported: All

Introduced with NLog 4.7

Configuration Syntax

${onHasProperties:inner=Layout}

Parameters

Transformation Options

  • inner - Wrapped layout. Layout
  • else - Layout if the condition is not true (introduced in NLog 5.0.5)

Example:

${onHasProperties:, Properties\: ${all-event-properties}}
Clone this wiki locally