Log Analytics
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to turn on log enrichment while maintaining json format in .NET?

ShaoHungYu
Newcomer

We have one agent installed in our Azure .NET web app, in the app service console log, the result description is in perfect json format.

I went to One Agent settings and turned these on

.NET - Trace/span context enrichment for logs [Opt-In]
.NET - Trace/span context enrichment for unstructured logs [Opt-In]
.NET - Trace/span context enrichment Framework Microsoft Logging Extensions

I can then see [!dt trace_id=,span_id=,trace_sampled=true] being added in my result description. Now my log has trace id and span id, but it is no longer a json format.

I experimented a little, like leave only .NET - Trace/span context enrichment for logs [Opt-In] on, I can see my log goes back to json format, but there is no trace id or span id injected.

Anyone faced the same issue before?

0 REPLIES 0

Featured Posts