From 2ef99428f9be29ec299029782edb97baef88e126 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 18 三月 2026 14:19:20 +0800
Subject: [PATCH] feat: 完成WCS/WMS任务链路与设备调度改造
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs | 17 ++++++++++++++++-
1 files changed, 16 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..8ea1382 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,20 @@
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/serilog-.log.txt",
+ rollingInterval: RollingInterval.Day,
+ retainedFileCountLimit: 30,
+ shared: true);
+});
builder.ConfigureApplication();
// App.ExpDateTime = DateTime.Parse("2025-03-31 00:00:00"); // 璁剧疆杩囨湡鏃堕棿
@@ -50,7 +65,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