【发布时间】:2018-03-02 17:21:53
【问题描述】:
这与this 的问题相同,但针对的是最新版本的应用洞察 2.2.1
自从更新到 2.2 版本后,即使它像以前那样被禁用,调试输出也充满了 AI 数据。
以前在启动时启用了 AI,我可以这样做:
services.AddApplicationInsightsTelemetry(options =>
{
options.EnableDebugLogger = false;
options.InstrumentationKey = new ConnectionStringGenerator().GetAITelemetryKey();
});
根据新的 VS 模板添加应用程序洞察力的新方法是将其添加到 Program.cs 中,如下所示:
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseApplicationInsights(connectionStringGenerator.GetAITelemetryKey())
.UseSerilog()
.Build();
在这种情况下,没有采用任何选项的构造,如果我删除“UseApplicationInsights”并恢复为原始方法,则没有任何区别。无论哪种方式,我的输出调试窗口都充满了 AI 日志。
事实上,即使没有加载 AI 的方法(即我同时删除了“UseApplicationInsights”和“AddApplicationInsightsTelemetry”,我也会得到日志。
感谢您的帮助。
【问题讨论】:
标签: asp.net-mvc .net-core azure-application-insights