Skip to content

Commit

Permalink
Update NLog examples (#1691)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyMothra authored Feb 19, 2020
1 parent 61a9de9 commit 58618d7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions LOGGING/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ If your application does not have web.config then it can also be configured manu
</nlog>
```

NLog allows you to configure conditional configs:

```xml
<instrumentationKey>${configsetting:APPINSIGHTS.INSTRUMENTATIONKEY:whenEmpty=${environment:APPINSIGHTS_INSTRUMENTATIONKEY}}</instrumentationKey>
```

For more information see:
- https://github.com/NLog/NLog/wiki/ConfigSetting-Layout-Renderer
- https://github.com/nlog/nlog/wiki/Environment-Layout-Renderer
- https://github.com/nlog/nlog/wiki/WhenEmpty-Layout-Renderer



```csharp
// You need this only if you did not define InstrumentationKey in ApplicationInsights.config (Or in the NLog.config)
TelemetryConfiguration.Active.InstrumentationKey = "Your_Resource_Key";
Expand Down

0 comments on commit 58618d7

Please sign in to comment.