feat: 完善日志记录分类

This commit is contained in:
陈淳
2024-01-10 15:03:26 +08:00
parent 3f2b0319fa
commit a3f7c1e867

View File

@@ -6,11 +6,12 @@ using Yi.Abp.Web;
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.AspNetCore.Hosting.Diagnostics",LogEventLevel.Error)
.MinimumLevel.Override("Microsoft.AspNetCore.Hosting.Diagnostics", LogEventLevel.Error)
.MinimumLevel.Override("Quartz", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("logs/log-.txt", rollingInterval: RollingInterval.Day))
.WriteTo.Async(c => c.Console())
.WriteTo.Async(c => c.File("logs/all/log-.txt", rollingInterval: RollingInterval.Day, restrictedToMinimumLevel: LogEventLevel.Debug))
.WriteTo.Async(c => c.File("logs/error/errorlog-.txt", rollingInterval: RollingInterval.Day, restrictedToMinimumLevel: LogEventLevel.Error))
.WriteTo.Async(c => c.Console(restrictedToMinimumLevel: LogEventLevel.Information))
.CreateLogger();
try