AspNet.Core OpenTelemetry AzureMonitorLogExporter doesn't include ILogger name in AppInsight traces.
ILogger log messages get written to app insights but there is some info missing compared to writing to for example file or console.
Console: InternalApi.DashboardController: Information: This is a info
App insights: Does not contain any additional infromation except the LogLevel and the message.
Can I somehow add more information to the traces or do i need to use Microsoft.ApplicationInsights.AspNetCore if i want that?
10 Replies
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
really simple
And looks like this under traces when i use
_logger.LogWarning...
where the ILogger is injected from the constructor.Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Yeah i've debugged that part of the code and the generated telemetryItems only contain the message and the log level
But i'll probably just use the classic ApplicationInsights library as there it seems to work oob
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
The customDimensions are populated from the actual log message when using composite formatting
Just not stuff like line number, Logger name, file name etc
https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-add-modify#add-a-custom-property-to-a-span
Maybe it needs to be done manually with a processor like this
Add, modify, and filter Azure Monitor OpenTelemetry for .NET, Java,...
This article provides guidance on how to add, modify, and filter OpenTelemetry for applications using Azure Monitor.
Okey, that seems to only work for traces and metrics
Same trace using the Microsoft.ApplicationInsights.AspNetCore with AddApplicationInsightsTelemetry()
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View