diff --git a/WebStarter/Program.cs b/WebStarter/Program.cs index 1cf3737..fb46159 100644 --- a/WebStarter/Program.cs +++ b/WebStarter/Program.cs @@ -1,7 +1,6 @@ using System.Text; using Autofac; using Autofac.Extensions.DependencyInjection; -using Common.Util; using Entity.Dto.Resp; using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.AutoTask; @@ -34,6 +33,13 @@ builder.Host.ConfigureContainer(cb => IsAutoCloseConnection = true, InitKeyType = InitKeyType.Attribute // 如果使用实体类的属性进行主键标识,请设置为 InitKeyType.Attr + }, c => + { + c.Aop.OnLogExecuting = (sql, pars) => + { + string nativeSql = UtilMethods.GetNativeSql(sql, pars); + log.Info(nativeSql); + }; }); return db; }).As().SingleInstance(); @@ -161,4 +167,4 @@ if (AppSettingsHelper.GetBool("swap", "enable")) TaskInit.Init(); -app.Run(); \ No newline at end of file +app.Run();