簡體   English   中英

在 Azure Function 中禁用記錄到 App Insights

[英]Disable logging to App Insights in Azure Function

我的日志從 function 應用程序變得非常滿。

似乎正在記錄檢查訂閱和 blob 存儲上的消息

在此處輸入圖像描述

我怎樣才能阻止這個?

"logging": {
    "logLevel": {
      "default": "Information",
      "Microsoft": "Warning",
      "System": "Warning",
      "Host": "Error",
      "Function": "Information",
      "Host.Aggregator": "Information",
      "Azure.Storage.Blobs": "Warning",
      "Host.Functions": "Warning"
    },
    "Serilog": {
      "MinimumLevel": "Information",
      "WriteTo": [
        {
          "Name": "Console",
          "Args": {
            "outputTemplate": "{Timestamp:HH:mm:ss} {Level} | {RequestId} - {Message}{NewLine}{Exception}"
          }
        }
      ]
    },

保羅

您可以使用“日志記錄”下的“ApplicationInsights”過濾掉發送到 ApplicationInsights 的日志。 例如,您可以將日志記錄配置更新為

{
  "Logging": {
    "LogLevel": {
      "Default": "Information"
    },
    "ApplicationInsights": {
      "LogLevel": {
        "Microsoft": "Error"
      }
    }
  }
}

在上面的示例中,即使默認日志級別設置為“信息”,對於ApplicationInsightsLoggerProvider ,也只有Error及以上的日志級別才會發送到 ApplicationInsights。

有關詳細信息,請參閱以下鏈接: 使用 ApplicationInsights 進行日志記錄的過濾器

暫無
暫無

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

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