dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.6k stars 25.29k forks source link

How to set LoggerFactoryOptions.ActivityTrackingOptions via appsettings.json? #25184

Closed svdHero closed 2 months ago

svdHero commented 2 years ago

This paragraph describes how to make a logger add the W3C trace context (trace id, span id, parent id, tc.) to all log messages.

Is there an easy way how I can configure this via appsettings.json without having to hardwire the logging configuration into my C# code? If so, could you please add a json code snippet to the documentation? Most other paragraphs on said site contain json examples for the configuration options.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 289453

Rick-Anderson commented 2 months ago

Nope. See https://learn.microsoft.com/en-us/aspnet/core/fundamentals/w3c-logger/