【发布时间】:2019-07-14 14:06:05
【问题描述】:
将Microsoft.ApplicationInsights.AspNetCore v2.6.1 与.net core v2.2.2 一起使用,我可以在Azure Application Insight Live Metric Stream 中看到遥测数据,但我没有看到我尝试在@ 内使用ILogger 记录的条目987654323@ 或在控制器中。
我已经在Program.cs 和Startup.cs 中尝试过.UseApplicationInsights() 和WebHost.CreateDefaultBuilder,就像这样,但无济于事。
services.AddApplicationInsightsTelemetry( options => {
options.EnableDebugLogger = true;
});
我看到传入请求和请求失败率,但没有日志条目
this.logger.Log(LogLevel.Error, $"Test Error {Guid.NewGuid().ToString()}");
this.logger.LogTrace($"Test Trace {Guid.NewGuid().ToString()}");
this.logger.LogInformation($"Test Information {Guid.NewGuid().ToString()}");
this.logger.LogWarning($"Test Warning {Guid.NewGuid().ToString()}");
this.logger.LogCritical($"Test Critical {Guid.NewGuid().ToString()}");
this.logger.LogError($"Test Error{Guid.NewGuid().ToString()}");
this.logger.LogDebug($"Test Debug {Guid.NewGuid().ToString()}");
【问题讨论】:
标签: c# azure asp.net-core logging azure-application-insights