serilog-contrib / serilog-sinks-applicationinsights

A Serilog sink that writes events to Microsoft Azure Application Insights
Apache License 2.0
220 stars 72 forks source link

cannot see stackTrace on application insight using serialog? #158

Closed mvaz77 closed 2 years ago

mvaz77 commented 3 years ago

I am just using ApplicationInsights Sink and using TraceTelemetryConverter in my config.

vincentbitter commented 3 years ago

That's not a lot of information. Can you share some code/configuration? What version of .NET are you using? In my case, the problem was that the instrumentation key was not set correctly.

benjaminc commented 3 years ago

I am having the same problem (at least as the title). I can see exception messages in Application Insights (and I can see other log messages as well), but when looking at the exception detail, in the Call Stack section it says call stack unavailable. Below is a screenshot of the details.

I am using .NET Framework 4.8 in an Azure Web App, with the following Serilog packages (the Sinks packages are conditionally enabled in code, I'm currently only using ApplicationInsights): Serilog: 2.10.0 Serilog.Enrichers.Process: 2.0.1 Serilog.Enrichers.Thread: 3.1.0 Serilog.Filters.Expressions: 2.1.0 Serilog.Formatting.Compact: 1.1.0 Serilog.Formatting.Compact.Reader: 1.0.4 Serilog.Settings.AppSettings: 2.2.2 Serilog.Sinks.ApplicationInsights: 3.1.0 Serilog.Sinks.Async: 1.4.0 Serilog.Sinks.AzureBlobStorage: 2.1.1 Serilog.Sinks.File: 4.1.0 Serilog.Sinks.Map: 1.0.2 Serilog.Sinks.PeriodicBatching: 2.3.0

The code I use to enable the logging is:

var log = new LoggerConfiguration()
    .WriteTo
    .ApplicationInsights(TelemetryConfiguration.Active, TelemetryConverter.Events, LogEventLevel.Verbose)
    .CreateLogger();

image

nblumhardt commented 2 years ago

Closing this one as stale; we're currently switching maintenance teams and low on bandwidth, unfortunately. If you can post to Stack Overflow under the serilog tag it's likely to get more eyes on it. Thanks!