How "WebApplication.CreateBuilder()" method configures default logging Providers.

Amit Rawat 586 Reputation points

How the "WebApplication.CreateBuilder()" method configures logging.

In ASP.NETCORE GitHub page "".

I can see the "ConfigureLogging" code is only enabled within WebHost.CreateDefaultBuilder() method.

But I am calling ""WebApplication.CreateBuilder()" and it returns "WebApplicationBuilder" object.

And even in WebApplicationBuilder class I am not able to find where these logging providers called.

Can anyone explain the flow how "WebApplication.CreateBuilder()" method configures default logging Providers.

A set of technologies in the .NET Framework for building web applications and XML web services.
3,137 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce ( 35,791 Reputation points

    see line 256:

    it configures and adds logging as a service. many components are configured to call logging if the service is configured.

    note the default logger is the console logger

    0 comments No comments