【发布时间】:2018-11-15 12:10:52
【问题描述】:
我有一个 .net core web api 项目。我只是想让我的跟踪语句如下所示出现在应用洞察中:
Trace.TraceInformation("Hello World!");
我在调试时在输出窗口中看到日志,但在部署后,我在日志中看不到任何跟踪语句......为什么?
我有 Microsoft.ApplicationInsights.AspNetCore 和 Microsoft.ApplicationInsights.TraceListener 包。
我知道应用洞察已设置,因为请求正在出现,并且我从未收集的性能指标中收到一条跟踪消息(请参阅下面的跟踪消息):
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
【问题讨论】:
-
不确定这是否是问题所在,但您如何配置您的应用洞察力?您是否将值设置为 APPINSIGHTS_INSTRUMENTATIONKEY?
标签: c# .net-core trace azure-application-insights system.diagnostics