Created
November 7, 2018 22:55
-
-
Save shawnwildermuth/fb635c26f0f79c6e25531b2ad467d7f9 to your computer and use it in GitHub Desktop.
Configure EF logging in ASP.NET Core App.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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