datalust / seq-extensions-logging

Add centralized log collection to ASP.NET Core apps with one line of code.
https://datalust.co/seq
Apache License 2.0
84 stars 12 forks source link

Capture `Activity` trace and span ids when present #56

Closed nblumhardt closed 6 months ago

nblumhardt commented 6 months ago

By default, the built-in trace and span ids will be recorded alongside any span-related properties (such as TraceId, SpanId, and ParentId) that may be added by the framework:

image

To remove the redundant properties (if you wish) you can set ActivityTrackingOptions via ILoggingBuilder.Configure():

builder.Logging.Configure(opts => opts.ActivityTrackingOptions = ActivityTrackingOptions.None);

image

The PR draws on the trace and span correlation support I added upstream in Serilog, and I've followed it pretty closely here.