Is .NET Core 2.0 logging broken?

后端 未结 4 599
情深已故
情深已故 2020-12-29 02:25

I can\'t seem to get Trace level log information outputted after upgrading to .NET Core 2.0 (+ASP.NET Core 2.0).

In fact, if I do a dotnet new webprojec

4条回答
  •  不知归路
    2020-12-29 02:57

    Nothing of the above works for me The only workaround was to write a method

    private void ConfigLogging( ILoggingBuilder builder ) {
        builder.SetMinimumLevel( LogLevel.Trace );
        //... additional configuration...
    }
    

    and when using the AddLogging extension method write it as

    services.AddLogging( ConfigLogging );
    

提交回复
热议问题