Skip to content

Commit

Permalink
Update README.md (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot authored Jul 11, 2023
1 parent c76d92f commit d74b81b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# NLog.DiagnosticSource
NLog DiagnosticListenerTarget for [Microsoft DiagnosticSource](https://github.com/dotnet/runtime/blob/master/src/libraries/System.Diagnostics.DiagnosticSource/src/DiagnosticSourceUsersGuide.md)

NLog ActivityTraceLayoutRenderer for [Microsoft Activity Trace](https://github.com/dotnet/runtime/blob/master/src/libraries/System.Diagnostics.DiagnosticSource/src/ActivityUserGuide.md)

NLog DiagnosticListenerTarget for [Microsoft DiagnosticSource](https://github.com/dotnet/runtime/blob/master/src/libraries/System.Diagnostics.DiagnosticSource/src/DiagnosticSourceUsersGuide.md)

[![Version](https://badge.fury.io/nu/NLog.DiagnosticSource.svg)](https://www.nuget.org/packages/NLog.DiagnosticSource)
[![AppVeyor](https://img.shields.io/appveyor/ci/nlog/NLog-DiagnosticSource/master.svg)](https://ci.appveyor.com/project/nlog/NLog-DiagnosticSource/branch/master)

Expand Down Expand Up @@ -79,6 +79,19 @@ ${activity:property=OperationName:parent=true}
${activity:property=OperationName:root=true}
```

**Manually configure ActivityTrackingOptions**

When using the default HostBuilder then it will automatically setup the following [ActivityTrackingOptions](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.loggerfactoryoptions.activitytrackingoptions):
```c#
builder.ConfigureLogging(loggingBuilder =>
loggingBuilder.Configure(options =>
options.ActivityTrackingOptions =
ActivityTrackingOptions.TraceId
| ActivityTrackingOptions.SpanId
| ActivityTrackingOptions.ParentId));
```
If creating a custom HostBuilder, then one have to manually setup the ActivityTrackingOptions like shown above.

### How to use DiagnosticListenerTarget

Use the target "diagnosticListener" in your nlog.config
Expand Down

0 comments on commit d74b81b

Please sign in to comment.