Skip to content

AspNet Request Trailers Layout Renderer

Rolf Kristensen edited this page Aug 28, 2023 · 7 revisions

ASP.NET Request Trailers

Platforms Supported: Limited (Only supported in Asp.NetCore)

Introduced with NLog.Web.AspNetCore v5.1.0

Configuration Syntax

${aspnet-request-trailersitems=String[]:outputFormat=Enum
    :itemSeparator=String:valueSeparator=String
    :valuesOnly=Boolean}

Options

Rendering Options

  • Items - Trailer names to be rendered. A list of keys can be passed as comma separated values, e.g.: Key1,Key2 (Not specified means all)

    Introduced with NLog.Web / NLog.Web.AspNetCore v5.2.1, and replaces the TrailerNames-option.

  • Exclude - Trailer names to be excluded. A list of keys can be passed as comma separated values, e.g.: Key1,Key2

Formatting options

  • outputFormat - Renders as flat string or as JSON. Default: Flat.
    • Flat - Key-value-pair as standard string
    • JsonArray - Key-value-pair in JSON-array
    • JsonDictionary - Key-value-pair as JSON-dictionary
  • itemSeparator - Separator between items. Default: ,. Only applies when OutputFormat is Flat.
  • valueSeparator - Separator between value and key. Default: =. Only applies when OutputFormat is Flat.
  • ValuesOnly - Only render the values of the key/value pairs. Default: false.
  • LowerCaseKeys - Convert Keys to lowercase. Default: false.

    Introduced in NLog.Web / NLog.Web.AspNetCore 5.1.1

Clone this wiki locally