英文:
How to exclude Request log entries in Azure Function logs?
问题
如何排除 Azure 函数应用程序日志输出中的 "Request" 日志条目?
这些条目似乎是由函数运行时自动生成的,而不是我手动创建或感兴趣的条目。它们似乎主要与 Blob 触发器的存储轮询等内容相关。我过去没有看到这些条目,但现在它们填满了我的日志,使我很难定位我感兴趣的日志。
我在我的 host.json 文件中有一些日志配置,但似乎没有改变任何内容。它看起来像下面这样...
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
},
"logLevel": {
"WhatInBoxFunctions": "Information"
}
}
}
英文:
How can I exclude the "Request" log entries in an Azure Function application's log output?
These entries seem to be generated by the Function runtime itself and are not entries that I am creating manually or interested in seeing. They appear to be mostly related to Storage polling for Blob Triggers, etc. I used to not see these entries but now they're filling up my logs and make it hard to locate the logs that I am interested in.
I do have some logging configuration in my host.json file, but it does not appear to change anything. It looks like below ...
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
},
"logLevel": {
"WhatInBoxFunctions": "Information"
}
}
}
答案1
得分: 1
-
感谢 @Delliganesh,我遵循了一些配置。
-
正如您在上面的截图中提到的,应该忽略请求 ID 记录。
-
对于日志条目和请求 ID,我已创建的函数应用在本地运行。
通过此方式排除的 请求类型,我可以在应用洞察日志中忽略请求 ID。
已更新的 host.json 模块:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
},
"logLevel": {
"default": "Warning",
"MyFunctionApp": "Information"
}
}
}
- 请检查以下的日志流:
英文:
-
Thanks @Delliganesh, I followed some configuration.
-
As you mentioned in above screenshot that the request ID logs should be Ignored.
-
For logs entries and request id's I have created function app works locally.
Request type excluded by this I can able to Ignore request id's in App insight logs.
Updated host.json module:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
},
"logLevel": {
"default": "Warning",
"MyFunctionApp": "Information"
}
}
}
- check below for log stream:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论