Browse Source

停用AbpSecurityLogOptions和AbpAuditingOptions

master
wanggang 1 year ago
parent
commit
3d02c0e4bd
  1. 7
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs

7
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs

@ -20,6 +20,7 @@ using Volo.Abp.AspNetCore.ExceptionHandling;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.ExceptionHandling; using Volo.Abp.AspNetCore.Mvc.ExceptionHandling;
using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.BackgroundJobs.Hangfire; using Volo.Abp.BackgroundJobs.Hangfire;
@ -33,6 +34,7 @@ using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SecurityLog;
using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Constant;
@ -136,6 +138,9 @@ namespace Win.Sfs.SettleAccount
// options.DefaultTimeout = 864000; //10 days (as seconds) // options.DefaultTimeout = 864000; //10 days (as seconds)
//}); //});
context.Services.Configure<AbpSecurityLogOptions>(o => o.IsEnabled = false);
context.Services.Configure<AbpAuditingOptions>(o => o.IsEnabled = false);
context.Services.Configure<FormOptions>(x => context.Services.Configure<FormOptions>(x =>
{ {
x.ValueLengthLimit = int.MaxValue; x.ValueLengthLimit = int.MaxValue;
@ -218,7 +223,6 @@ namespace Win.Sfs.SettleAccount
} }
options.Filters.Add(typeof(CustomExceptionFilter)); options.Filters.Add(typeof(CustomExceptionFilter));
}); });
} }
private void ConfigureMultiTenancy() private void ConfigureMultiTenancy()
@ -409,6 +413,7 @@ namespace Win.Sfs.SettleAccount
{ {
this.logger = logger; this.logger = logger;
} }
public void OnException(ExceptionContext context) public void OnException(ExceptionContext context)
{ {
logger.LogError(new EventId(context.Exception.HResult), context.Exception, context.Exception.Message); logger.LogError(new EventId(context.Exception.HResult), context.Exception, context.Exception.Message);

Loading…
Cancel
Save