Azure函数:如何使用本地调试模式将我的日志写入Azure应用程序洞察,以及使用Python的Azure函数? [英] Azure Function : How do I write my logs to Azure Application Insights using local debug mode with Azure Functions using Python?

查看:56
本文介绍了Azure函数:如何使用本地调试模式将我的日志写入Azure应用程序洞察,以及使用Python的Azure函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的日志写入Azure应用程序洞察,但我不知道如何实现。
我是否需要更新我的azure函数local.settings.jsonhost.json文件??
另外,我是否需要使用init.py文件中的调用特定函数将我的日志写入Azure Application Insights?
你能分享一些写日志的例子吗? 请注意-我的Azure函数使用的是Python。
谢谢

推荐答案

这是主机。json:

{
    "version": "2.0",
    "logging": {
        "applicationInsights": {
            "samplingSettings": {
                "isEnabled": true,
                "excludedTypes": "Request"
            }
        }
    }
}

这是官方设置:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json#applicationinsights

‘applicationInsights.samplingSettings.isEnabled’将启用或禁用采样。

这篇关于Azure函数:如何使用本地调试模式将我的日志写入Azure应用程序洞察,以及使用Python的Azure函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆