在Azure Function中禁用记录到App Insights

uqjltbpv  于 2023-01-14  发布在  其他
关注(0)|答案(1)|浏览(128)

我的日志从一个功能应用程序变得非常满。
看起来好像正在记录订阅和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}"
          }
        }
      ]
    },

保罗

lvjbypge

lvjbypge1#

您可以使用“日志记录”下的“ApplicationInsights”筛选发送到ApplicationInsights的日志。例如,您可以将日志记录配置更新为

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

在上面的示例中,即使默认日志级别设置为“信息”,对于ApplicationInsightsLoggerProvider,也只会将错误及以上的日志级别发送到ApplicationInsights。
有关详细信息,请参阅以下链接:使用ApplicationInsights进行日志记录的筛选器

相关问题