Azure Functions
An Azure service that provides an event-driven serverless compute platform.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have added below code
.ConfigureLogging(logging => {
logging.Services.Configure<LoggerFilterOptions>(options =>
{
LoggerFilterRule defaultRule = options?.Rules?.FirstOrDefault(rule => rule.ProviderName
== "Microsoft.Extensions.Logging.ApplicationInsights.ApplicationInsightsLoggerProvider");
if (defaultRule is not null)
{
options.Rules.Remove(defaultRule);
}
});
})
.Build()
Hi @Kunal NET
Not certain why you're removing that rule, but I don't believe it's necessary. You can scope your logging using appsettings.json to set the Log level and namespaces you want to filter out. Having said that, I would advise reviewing Logging in C# - .NET | Microsoft Learn, start with the basics and then begin to add filtering one step at a time.