From f56441867f2cc77567f97a92348a5d878f0dca05 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 12 三月 2026 18:24:15 +0800
Subject: [PATCH] Add AGENTS instructions and updates
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
index 1d708bf..cf44abb 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -11,6 +11,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
+using Serilog;
using WIDESEA_Core;
using WIDESEA_Core.Authorization;
using WIDESEA_Core.BaseServices;
@@ -35,6 +36,16 @@
config.Sources.Clear();
config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
});
+
+builder.Host.UseSerilog((context, services, loggerConfiguration) =>
+{
+ loggerConfiguration
+ .ReadFrom.Configuration(context.Configuration)
+ .ReadFrom.Services(services)
+ .Enrich.FromLogContext()
+ .WriteTo.Console()
+ .WriteTo.File("logs/log-.txt", rollingInterval: RollingInterval.Day);
+});
builder.ConfigureApplication();
// App.ExpDateTime = DateTime.Parse("2025-03-31 00:00:00"); // 璁剧疆杩囨湡鏃堕棿
@@ -50,7 +61,7 @@
builder.Services.AddSqlsugarSetup(); // SqlSugar 鏁版嵁搴撻厤缃�
builder.Services.AddDbSetup(); // Db 鏁版嵁搴撻厤缃�
builder.Services.AddInitializationHostServiceSetup(); // 搴旂敤绋嬪簭鍒濆鍖栨湇鍔℃敞鍐�
-builder.Services.AddHostedService<AutoOutboundTaskBackgroundService>();
+builder.Services.AddHostedService<AutoOutboundTaskBackgroundService>(); // 鍚姩鑷姩鍑哄簱浠诲姟鍚庡彴鏈嶅姟
// builder.Services.AddHostedService<PermissionDataHostService>(); // 鏉冮檺鏁版嵁鏈嶅姟
builder.Services.AddAutoMapperSetup();
--
Gitblit v1.9.3