Add logging to Entity Framework Core workload.
This commit is contained in:
parent
6e0167a051
commit
25ede5cc28
@ -1,6 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
using EntityFrameworkCore.Domain;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace EntityFrameworkCore.Data;
|
||||
|
||||
@ -19,7 +20,10 @@ public class DeadBallZoneLeagueDbContext : DbContext
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseSqlite($"Data source={DbPath}");
|
||||
optionsBuilder.UseSqlite($"Data source={DbPath}")
|
||||
.LogTo(Console.WriteLine, LogLevel.Information)
|
||||
.EnableSensitiveDataLogging() // Do not allow this in Production.
|
||||
.EnableDetailedErrors(); // Do not allow this in Production.
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user