Quantcast
Channel: Code – no dogma blog
Viewing all articles
Browse latest Browse all 132

How to Turn Off Console Logging for Kestrel in .NET Core

$
0
0

This post is mostly a note to myself.

I am often annoyed with the amount of logging to the console that occurs when I start a Kestrel hosted application and I can never remember how to turn it off.

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
    .ConfigureLogging(loggingBuilder => 
        loggingBuilder.AddFilter<ConsoleLoggerProvider>(level => 
            level == LogLevel.None))
        .UseStartup<Startup>();


Viewing all articles
Browse latest Browse all 132

Trending Articles