mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(dir): ✨ enable debug EF logging
This commit is contained in:
parent
f1dfd0a1c4
commit
60a787199e
1 changed files with 10 additions and 1 deletions
|
|
@ -5,6 +5,9 @@
|
|||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
#if DEBUG
|
||||
using Microsoft.Extensions.Logging;
|
||||
#endif
|
||||
|
||||
namespace FilterLists.Directory.Infrastructure;
|
||||
|
||||
|
|
@ -21,7 +24,13 @@ public static void AddInfrastructureServices(this IServiceCollection services, I
|
|||
services.AddDbContextPool<QueryDbContext>(o =>
|
||||
{
|
||||
o.UseNpgsql(configuration.GetConnectionString("DirectoryConnection"),
|
||||
po => po.MigrationsAssembly("FilterLists.Directory.Infrastructure.Migrations"));
|
||||
po => po.MigrationsAssembly("FilterLists.Directory.Infrastructure.Migrations"))
|
||||
#if DEBUG
|
||||
.LogTo(Console.WriteLine, LogLevel.Information);
|
||||
o.EnableSensitiveDataLogging();
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
});
|
||||
services.AddScoped<IQueryContext, QueryContext>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue