Skip to content

Instantly share code, notes, and snippets.

@shawnwildermuth
Created November 7, 2018 22:55
Show Gist options
  • Save shawnwildermuth/fb635c26f0f79c6e25531b2ad467d7f9 to your computer and use it in GitHub Desktop.
Save shawnwildermuth/fb635c26f0f79c6e25531b2ad467d7f9 to your computer and use it in GitHub Desktop.
Configure EF logging in ASP.NET Core App.
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureLogging(ConfigLogging)
.UseStartup<Startup>();
static void ConfigLogging(ILoggingBuilder bldr)
{
bldr.AddFilter(DbLoggerCategory.Query.Name, LogLevel.Information);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment