Using Application Insights with ILoggerFactory

后端 未结 5 1987
攒了一身酷
攒了一身酷 2020-12-31 08:44

I\'m trying to log exceptions to Application Insights. I succeeded in doing this by calling TelemetryClient.TrackException directly. However, I would like to ab

5条回答
  •  盖世英雄少女心
    2020-12-31 08:57

    Here is the documentation of App Insights with ILogger. For me it worked however got tons of Trace log so recommend you to apply custom filters:

    builder.AddApplicationInsights("ikey");
    
    builder.AddFilter
                ("", LogLevel.Information);
    builder.AddFilter
                ("Microsoft", LogLevel.Warning);
    

提交回复
热议问题