How to Opt-Out Serilog and Use Azure Monitor OpenT...
# help-with-umbraco
k
I want to see Umbraco application's logs in Application Insights. I'm using the following packages: Azure.Monitor.OpenTelemetry.AspNetCore Serilog.Sinks.OpenTelemetry
builder.Services.AddOpenTelemetry().UseAzureMonitor()
The issue is with the app inights Serilog Sink I am loosing a lot of telemetry and I have my whole setup built arounf OTEL standards and OTEL exporters, which Azure monitor provides, and with Serilog I think it kills all exporters, On my custom dotnet application I used Serilog flag
writeToProviders
so I'd have both logger in action, but for Umbraco I do not know what is the best way to do so
Copy code
services.AddSerilog((loggerConfiguration) =>
 {
     loggerConfiguration.MinimalConfiguration(configuration)
                        .ReadFrom.Configuration(configuration);
 }, writeToProviders: true);
For anyone coming across this: below is how to enrich your Serilog Application Insights with span and trace IDs along with cloud role name and cloud role instance to follow OTEL span logging standards. https://gist.github.com/islamkhattab/264316dbd7f6662f0ee71612323ed0c4
73 Views