I have a asp.net core 2 application where i am trying to log traces using LoggerMessage extension methods.(https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/loggermessage). The default trace level is set to trace. I am logging Critical,Errors,Warnings and Information messages. These appear on the console and the debug window. But are not reported to application insights.
I have Added ".UseApplicationInsights()" to the web host builder and added the "_loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace);" to the startup. I have also ensure that the app insights key is set in the appsetting.json file.
"ApplicationInsights": { "InstrumentationKey": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX" }, Can someone help me with what am i missing?
SDK Version Microsoft.ApplicationInsights.AspNetCore - 2.1.1 Microsoft.AspNetCore.All - 2.0.5
UseApplicationInsightsandAddApplicationInsightsare mutually exclusive ways to set up Application Insights for your application. You need to choose only one way, in your case, removeUseApplicationInsightscall inProgram.cs- twinmind