[英]Azure Function : How do I write my logs to Azure Application Insights using local debug mode with Azure Functions using Python?
I want to write my logs to the Azure Application Insights but I do not know how to achieve it.我想将我的日志写入 Azure Application Insights,但我不知道如何实现。
Do I need to update my azure function local.settings.json and host.json file ??我需要更新我的 azure 函数local.settings.json和host.json文件吗??
Also, do I need to use call specific function in init .py file to write my logs to Azure Application Insights?另外,我是否需要使用init .py文件中的调用特定函数将我的日志写入 Azure Application Insights?
Can you please share some examples to write logs.你能分享一些写日志的例子吗? Please note- I am using python for my Azure function.请注意 - 我在 Azure 函数中使用 python。
Thanks谢谢
This is the host.json:这是host.json:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
}
}
This is the official settings:这是官方设置:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json#applicationinsights https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json#applicationinsights
'applicationInsights.samplingSettings.isEnabled' is to Enables or disables sampling. 'applicationInsights.samplingSettings.isEnabled'是启用或禁用采样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.