![](/img/trans.png)
[英]What is the reason for host lock lease acquired by instance id in Azure function?
[英]Disable logging of host lock lease renew calls in Azure Function
Every 5 seconds my Azure Function is logging the http request to Azure blob storage and response to renew the host lock lease. “host.json”文件的日志記錄部分中是否有設置可以關閉這些設置?
這些是“信息”級別的消息。 我嘗試將“主機”的日志級別設置為“警告”,如下所示:
{
"version": "2.0",
"logging": {
"logLevel": {
"default": "Debug",
"Host": "Warning"
}
}
}
但這似乎不起作用。
以下是您可以遵循的一些解決方法:
您可以嘗試將以下 cmd 添加到您的host.json
。 Function V2 中的 json:
{
"version": "2.0",
"logging": {
"logLevel": {
"Function.MyFunctionName.User": "Information",
"Function": "Error"
}
}
}
也基於MS DOC :
若要禁用內置日志記錄,請刪除
AzureWebJobsDashboard
應用設置。 有關如何刪除 Azure 門戶中的應用程序設置的信息,請參閱如何管理功能應用程序的應用程序設置部分。
有關更多信息,請參閱: host.json 參考 Azure 函數 2.x| MS DOC & SO 線程
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.