在 Log Analytics 中显示详细异常详细信息

Displaying Verbose Exception Details in Log Analytics

我有一个 Azure Function 应用程序,我将 Application Insights 与 ILogger 一起用于跟踪和异常日志记录。

在我捕获异常的地方,然后使用 ILogger.LogError 方法将捕获的异常对象作为第二个参数进行记录 (ms docs description)

这很好用,并且记录了包括堆栈跟踪在内的异常详细信息。我的问题是以易于阅读的方式显示此详细信息。我可以 运行 在 Azure 门户中进行以下 kusto 查询,但结果显示在一个小的 table.

exceptions
| limit 10
| sort by timestamp desc 
| project timestamp, details,  outerMessage, innermostMessage

有没有快速查看异常数据的方法?我尝试 "pin to dashboard" 但收到消息 "Don't have permissions to create a new dashboard for this resource group." - 即使是我创建了选定的资源组。

您是否在门户的“搜索”页面而不是 Analytics 中查找异常? https://docs.microsoft.com/en-us/azure/azure-monitor/app/diagnostic-search https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-exceptions

它显示异常堆栈等。您可以过滤遥测数据,然后从搜索页面跳转到分析,搜索页面使用的 kusto 查询将为您填充。

感谢@cijothomas - 需要检查 "Event types" 选项