I have a .net core web api project. I am simply trying to get my trace statements like below to appear in app insights:
Trace.TraceInformation("Hello World!");
I see the log in my output window when I am debugging, but after I deploy, I am not seeing any of my trace statements in the logs.... Why?
I have the Microsoft.ApplicationInsights.AspNetCore
, and Microsoft.ApplicationInsights.TraceListener
packages included.
I know App insights is setup, because the requests are appearing, and I am getting one trace message from the performance metrics not getting collected (see trace message below):
AI: Error collecting 3 of the configured performance counters. Please check the configuration.
Counter \ASP.NET Applications(??APP_W3SVC_PROC??)\Requests/Sec: Failed to perform the first read for performance counter. Please make sure it exists. Category: ASP.NET Applications, counter: Requests/Sec, instance MyAPI.exe
Counter \ASP.NET Applications(??APP_W3SVC_PROC??)\Request Execution Time: Failed to perform the first read for performance counter. Please make sure it exists. Category: ASP.NET Applications, counter: Request Execution Time, instance MyAPI.exe
Counter \ASP.NET Applications(??APP_W3SVC_PROC??)\Requests In Application Queue: Failed to perform the first read for performance counter. Please make sure it exists. Category: ASP.NET Applications, counter: Requests In Application Queue, instance