For Error Type Message show blanks in Invocation details for .NET 8 isolated

Kunal NET 0 Reputation points
2024-10-23T18:42:05.6033333+00:00

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()

1000071731

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
Developer technologies | ASP.NET | ASP.NET Core
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,306 Reputation points Microsoft Employee Moderator
    2024-11-18T13:39:39.6733333+00:00

    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.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.