Azure Monitor/Application Insights 不显示错误的堆栈跟踪

标签 azure asp.net-core-mvc azure-application-insights azure-monitoring

我有一个托管在 Azure 应用服务上的 ASP .Net Core 3.0 Web API。 我试图找出为什么它在 Controller 操作方法之一中抛出 500 内部服务器错误。 我已经设置了 Application Insights,并且可以在 Azure 门户上的“失败”页面上看到有多个 500 异常。但是,我看不到它们的堆栈跟踪。我需要做什么才能在 Application Insights 或 Azure Monitor 中打开堆栈跟踪报告。 附:即使我的 API 在 .Net Core 2.2 上,它也没有显示堆栈跟踪,因此它不是 .Net Core 3.0 的东西。

以下是一些屏幕截图:

enter image description here

enter image description here

最佳答案

在应用洞察查询窗口中,编写一个查询来显示异常并投影名为“详细信息”的属性。其中包含堆栈跟踪信息。

 exceptions
| where timestamp > ago(30d)
| order by timestamp asc
| project timestamp, message = iff(message != '', message, iff(innermostMessage != '', innermostMessage, customDimensions.['prop__{OriginalFormat}'])), details

关于Azure Monitor/Application Insights 不显示错误的堆栈跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58376320/

相关文章:

azure - 将最新文件从 S3 复制到 Azure Blob(使用 Azure Factory V2)

c# - 在 Azure 中设置 MySQL 后端以进行 Xamarin 离线同步

azure - 如何使用 Bicep 通过 .Net 堆栈部署 Windows Azure 应用服务?

c# - 将 Application Insights 查询 API 调用结果转换为 DataTable

angular - '引用错误: define is not defined' when testing Angular app with jest using ApplicationInsights-js

c# - SendGrid 电子邮件不适用于生产环境

asp.net-mvc - F# 支持最新的 asp.net 5 和 MVC6

c# - 如何有条件地删除 Controller 由 ASP.NET Core 注册并添加到 ServiceCollection

iis - 在 IIS 上部署 ASP.Net core 1 应用程序(404 错误)

azure - 在 Spring Boot 应用程序中使用 applicationinsights 进行日志记录