簡體   English   中英

我在 Azure Function Monitor Logs 屏幕中看到了條目。 如何在 Application Insights 中找到它們?

[英]i see entries in then Azure Function Monitor Logs screen. How do I find them in the Application Insights?

我通過單擊Functions/FunctionName/Monitor/Logs打開 Azure 函數的Functions/FunctionName/Monitor/Logs 它顯示“正在連接到 Application Insights...”,然后是“已連接”。 我運行該函數,監視器屏幕顯示由_logger.LogInformation()調用生成的條目。

在此處輸入圖片說明

然后,我嘗試在 Application Insight 中找到這些條目(特別是第 3 行表示Started orchestration ),但我似乎無法找到。

我試過搜索,一無所獲。
在此處輸入圖片說明

我也試過查詢它,也沒有。
在此處輸入圖片說明

我在這里缺少什么?

PS 使用 .NET Core 3.1 和 Microsoft.NET.Sdk.Functions 3.0.9。

PPS 解決方案是將"logLevel": {"default": "Information"}到 host.json,如下所示:

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

根據官方文檔 -> logging ,您應該指定日志級別,如下所示:

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

如果您想記錄information級別消息(對於所有日志級別,請參閱Log levels ),您應該將其指定為Information

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM