Azure函数配置用于记录所有内容,而无需对应用程序进行任何采样

Azure函数配置用于记录所有内容,而无需对应用程序进行任何采样,azure,logging,azure-functions,azure-application-insights,azure-function-app,Azure,Logging,Azure Functions,Azure Application Insights,Azure Function App,我不需要任何采样,只想记录请求、customEvents、traces和异常中的所有数据 使用以下host.json是否可以确保通过Azure函数中的遥测对象记录的所有数据在相应的AppInsight实例上始终存在 { "version": "2.0", "logging": { "applicationInsights": { "samplingSettings":

我不需要任何采样,只想记录
请求、customEvents、traces
异常中的所有数据

使用以下
host.json
是否可以确保通过Azure函数中的遥测对象记录的所有数据在相应的AppInsight实例上始终存在

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": false
      }
    }
  }
}

是的,这是在azure函数中禁用采样的正确方法

更重要的是,如果您想记录所有类型的数据,还需要将跟踪设置为
Trace
。有关如何在
host.json
中设置日志级别,请参阅