Successfully added
Azure
by Patrik
How to Add LogLevel to Application Insights Logs
Application Insights doesn’t store the original .NET LogLevel
(like Debug
or Trace
) — it only stores SeverityLevel
, which combines them. To make your logs easier to filter and analyze, you can add LogLevel
as a custom property using a TelemetryInitializer
.
Example:
Integration
Register the initializer in your app:
services.AddSingleton<ITelemetryInitializer, LogLevelInitializer>();
Now, every trace will include a LogLevel
key in customDimensions
.
Referenced in:
Comments