WebHost.CreateDefaultBuilder() 会注册以下2个LoggingProvider,请问如何移除?
logging.AddConsole();
logging.AddDebug();
调用 ClearProviders() 方法可移除
IWebHostBuilder webHostBuilder = WebHost.CreateDefaultBuilder()
.ConfigureLogging(logging =>
{
logging.ClearProviders();
});
IWebHostBuilder webHostBuilder = WebHost.CreateDefaultBuilder()
.ConfigureLogging(logging =>
{
logging.ClearProviders();
//设置最低log 要求
logging.SetMinimumLevel(LogLevel.Error);
});