Hey @Singh, Rahul
When it comes to logging for dotnet-isolated
, have a look at Managing log levels in under Guide for running C# Azure Functions in an isolated worker process | Microsoft Learn. Log levels are separate between Application Insights and the host.What I suggest doing is setting the default to warning
or error
to prevent excessive logging and adjust logging for Host.
{
"logging": {
"fileLoggingMode": "debugOnly",
"logLevel": {
"default": "Warning",
"Host.Aggregator": "Trace",
"Host.Results": "Information",
"Function": "Information"
}
}
}
You can also look at filtering specific namespaces that you're not interested in seeing logged.
.ConfigureLogging(logging =>
{
// Disable IHttpClientFactory Informational logs.
logging.AddFilter("System.Net.Http.HttpClient", LogLevel.Warning);
})
You can also remove message handlers, see https://github.com/aspnet/HttpClientFactory/issues/196#issuecomment-432755765.