diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs index 1a21e129f3..b9cf4e3ceb 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/DependencyInjection/AbpDbContextConfigurationContext.cs @@ -2,6 +2,8 @@ using System.Data.Common; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using Volo.Abp.DependencyInjection; namespace Volo.Abp.EntityFrameworkCore.DependencyInjection @@ -29,7 +31,8 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection ConnectionStringName = connectionStringName; ExistingConnection = existingConnection; - DbContextOptions = new DbContextOptionsBuilder(); + DbContextOptions = new DbContextOptionsBuilder() + .UseLoggerFactory(serviceProvider.GetRequiredService()); } } @@ -49,7 +52,8 @@ namespace Volo.Abp.EntityFrameworkCore.DependencyInjection connectionStringName, existingConnection) { - base.DbContextOptions = new DbContextOptionsBuilder(); + base.DbContextOptions = new DbContextOptionsBuilder() + .UseLoggerFactory(serviceProvider.GetRequiredService()); } } } \ No newline at end of file