我在“ Azure功能监视器日志”屏幕中看到条目如何在Application Insights中找到它们?

问题描述

我通过单击Functions/FunctionName/Monitor/Logs打开Monitor for Azure功能。它显示“正在连接到Application Insights ...”,然后显示“已连接”。我运行该功能,“监视器”屏幕显示_logger.Log@R_211_4045@ion()调用生成的条目。

enter image description here

然后我尝试在Application Insight中找到那些条目(特别是在第三行显示Started orchestration),但是我似乎找不到。

我尝试搜索,但一无所获。

enter image description here

我也尝试查询它,也没有。

enter image description here

在这里想念什么?

P.S。将.NET Core 3.1与Microsoft.NET.Sdk.Functions 3.0.9一起使用。

P.P.S。解决方案是将"logLevel": {"default": "@R_211_4045@ion"}添加到host.json中,如下所示:

{
  "version": "2.0","logging": {
    "applicationInsights": {
      "samplingExcludedTypes": "Request","samplingSettings": {
        "isEnabled": true
      }
    },"logLevel": {"default": "@R_211_4045@ion"}
  }
}

解决方法

根据the official doc -> logging,您应指定如下日志级别:

"logLevel": {"default": "your_log_level"}

如果要记录information级别的消息(有关所有日志级别,请参阅Log levels),则应将其指定为Information

"logLevel": {"default": "Information"}