Skip to content

AppSetting Layout Renderer

Rolf Kristensen edited this page Jun 13, 2019 · 11 revisions

Value from the App Settings configuration (app.config / web.config)

Platforms Supported: Limited (Not supported on Silverlight, Xamarin Android/iOS, NetCore)

NLog 4.6 has this included in the core NLog.dll for NetFramework (Not for NetCore that has ${configsetting})

NLog 3.0+ requires additional dependency on NLog.Extended

Configuration Syntax



Rendering Options

  • item - Key in the apps setting. Required (NLog 4.5 and older used name)
  • Default - Default value if not present. Optional.

Example AppSettings

Example .config

    <add key="MyKey" value="MyApplication" />

Example renderer: produces MyApplication is this case:


Example#2 renderer: produces mydefault is this case:


Example ConnectionStrings

Introduced with NLog 4.6.5

    <add key="MyKey" value="MyApplication" />
    <add name="ElasticUrl" connectionString="http://localhost:9200"/>

Example#3 renderer: produces http://localhost:9200 is this case:

Clone this wiki locally
You can’t perform that action at this time.