Created
December 16, 2021 13:12
-
-
Save slamidtfyn/7bc75386c08b8d15c53d083f1f6de682 to your computer and use it in GitHub Desktop.
sql debug log from entityframework
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 myDbContext : DbContext | |
{ | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ | |
base.OnConfiguring(optionsBuilder); | |
optionsBuilder.UseLoggerFactory(MyLoggerFactory); | |
} | |
public static readonly ILoggerFactory MyLoggerFactory | |
= LoggerFactory.Create(builder => { builder.AddConsole(); }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment