Reputation: 79
I run a Kusto query for detect the which logs are collecting in my C# function app and then I see there is too much unnecessary log collections in storage :
I want disable all log collections except for "AppExceptions", all other logs are not necessary for me. (Especially I want to turn off "AppRequests" and "AppMetrics") How can I disable them?
Azure functions version: v3
Upvotes: 3
Views: 2106
Reputation: 4786
If you don't want to collect all log information from your app you have to configure the log categories in your app.
Function.<YOUR_FUNCTION_NAME>
, Function.<YOUR_FUNCTION_NAME>.User
, Host.Aggregator
, Host.Results
, Microsoft
& Worker
.{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request" // Exclude the Request
}
},
"fileLoggingMode": "always",
"logLevel": {
"default": "Error", // It will log Error or higher level log
"Host.Results": "Error",
"Function": "Error",
"Host.Aggregator": "Error",
"Function.Function1": "Error",
"Function.Function1.User" : "Error"
}
}
}
You can edit host.json in App Service Editor / Kudu if your app already in production.
AzureWebJobsDashboard
in an Application Settings. (It is recommended for High load function).Upvotes: 1