When debugging a typical ASP.NET Core app with one of the default templates, I am faced with duplicate log lines in the DEBUG CONSOLE, e.g.:
It is extremely annoying because it makes the log difficult to read by constantly switching indentation and with repetitions. I have not configured any logging in Program.cs nor in Startup.cs, so the default configuration is doing this.
Why is it doing this, and can I remove it?
I thought maybe the root cause was because CreateDefaultBuilder(...) adds both debug and console logging. So I tried rolling my own:
.ConfigureLogging((hostingContext, logging) =>
{
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
logging.AddConsole();
//logging.AddDebug();
logging.AddEventSourceLogger();
})
But that had no effect.
