azure - Azure Monitor / Application Insights 未显示错误堆栈跟踪
问题描述
我有一个托管在 Azure App Service 上的 ASP .Net Core 3.0 Web API。我试图弄清楚为什么它会在其中一种控制器操作方法中引发 500 Internal Server Error。我已经设置了 Application Insights,我可以在 Azure 门户的“失败”页面上看到有 500 个异常。但是,我看不到它们的堆栈跟踪。我需要做些什么才能在 Application Insights 或 Azure Monitor 中打开堆栈跟踪报告。PS 即使我的 API 在 .Net Core 2.2 上,它也没有显示堆栈跟踪,所以它不是 .Net Core 3.0 的东西。
这是一些屏幕截图:
解决方案
在应用洞察查询窗口中,编写查询以显示异常并投影名为“详细信息”的属性。其中包含堆栈跟踪信息。
exceptions
| where timestamp > ago(30d)
| order by timestamp asc
| project timestamp, message = iff(message != '', message, iff(innermostMessage != '', innermostMessage, customDimensions.['prop__{OriginalFormat}'])), details
推荐阅读
- flutter - Flutter 在声明 Future 变量并为其提供方法返回值时出错
- python - ValueError: int() 以 10 为底的无效文字:''(串行端口通信字符串到整数错误)
- amazon-web-services - 您不能为现有 IPv4 CIDR 规则指定引用的组 ID。在 AWS 安全组中编辑入站规则时提示
- python - Python。从列表中删除具有其他扩展名的类似项目
- javascript - PDF.JS 自定义查看器在多页查看器中设置默认缩放视口值
- typescript - 在服务器上运行 docker 命令不起作用
- api - .NET:无法从传输连接读取数据:I/O 操作已中止
- css - 为什么减少行高不减少(点击)区域?
- visual-studio - 如何在html文件中syntex突出显示Latex
- kotlin - 如何从命令行运行 kotlin 脚本?