我想将我的日志写入 Azure Application Insights,但我不知道如何实现。
我是否需要更新我的 azure 函数 local.settings.json 和 host.json 文件??
另外,我是否需要使用 init.py 文件中的调用特定函数来将我的日志写入 Azure Application Insights?
你能分享一些例子来写日志吗?
请注意-我正在为我的 Azure 函数使用 python。
谢谢
最佳答案
这是 host.json:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
}
}
这是官方设置:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#applicationinsights
'applicationInsights.samplingSettings.isEnabled' 用于启用或禁用采样。
关于python - 天蓝色函数 : How do I write my logs to Azure Application Insights using local debug mode with Azure Functions using Python?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68109998/