python - 天蓝色函数 : How do I write my logs to Azure A

我想将我的日志写入 Azure Application Insights,但我不知道如何实现。
我是否需要更新我的 azure 函数 local.settings.jsonhost.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/

相关文章:

javascript - 如何在 vscode 中查看全 Angular 代码

swift - Table 行为中的 TextField

amazon-web-services - Terraform 在配置 S3 后端时出错

javascript - 如何验证 Cypress 中的悬停文本(工具提示)?

c# - 在 UWP 中,我应该在哪里保存用户数据?

node.js - 我安装了 npm live server (js.node) 但它不起作用?

php - 修改 Sonata Media Bundle 时预览列消失

java - 在没有调试器的情况下在 VS Code 中导航 Java 堆栈跟踪

python - 使用持续联系 API

android - 在 Android 11 中录制音频的前台服务有什么意义?