From b690250002ee04f4309e6a90fd16fbfd9bd959e2 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 01 五月 2026 23:11:23 +0800
Subject: [PATCH] feat(router): 添加托盘操作页面路由
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs | 44 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
index 43e60a1..d2e1d7a 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -10,6 +10,7 @@
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using Serilog;
+using Serilog.Events;
using Serilog.Formatting.Json;
using System.Reflection;
using System.Text;
@@ -20,6 +21,7 @@
using WIDESEA_Core.Extensions;
using WIDESEA_Core.Filter;
using WIDESEA_Core.Helper;
+
//using WIDESEA_Core.HostedService;
using WIDESEA_Core.Middlewares;
using WIDESEA_WMSServer.BackgroundServices;
@@ -56,6 +58,43 @@
fileSizeLimitBytes: 10 * 1024 * 1024,
shared: true
)
+ // 鍒嗗鏌滄帴鍙g嫭绔嬫棩蹇楁枃浠�
+ .WriteTo.Logger(lc => lc
+ .Filter.ByIncludingOnly(e => e.Properties.TryGetValue("SourceContext", out var sc) && sc is ScalarValue sv && sv.Value?.ToString() == "鍒嗗鏌滃畬鎴愪俊鍙�")
+ .WriteTo.File(
+ "logs/鍒嗗鏌滃畬鎴愪俊鍙�-.log",
+ outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}",
+ rollingInterval: RollingInterval.Day,
+ retainedFileCountLimit: 30,
+ fileSizeLimitBytes: 10 * 1024 * 1024,
+ shared: true))
+ .WriteTo.Logger(lc => lc
+ .Filter.ByIncludingOnly(e => e.Properties.TryGetValue("SourceContext", out var sc) && sc is ScalarValue sv && sv.Value?.ToString() == "鍒嗗鏌滅姸鎬佹洿鏂�")
+ .WriteTo.File(
+ "logs/鍒嗗鏌滅姸鎬佹洿鏂�-.log",
+ outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}",
+ rollingInterval: RollingInterval.Day,
+ retainedFileCountLimit: 30,
+ fileSizeLimitBytes: 10 * 1024 * 1024,
+ shared: true))
+ .WriteTo.Logger(lc => lc
+ .Filter.ByIncludingOnly(e => e.Properties.TryGetValue("SourceContext", out var sc) && sc is ScalarValue sv && sv.Value?.ToString() == "鍒嗗鏌滃嚭搴撹姹�")
+ .WriteTo.File(
+ "logs/鍒嗗鏌滃嚭搴撹姹�-.log",
+ outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}",
+ rollingInterval: RollingInterval.Day,
+ retainedFileCountLimit: 30,
+ fileSizeLimitBytes: 10 * 1024 * 1024,
+ shared: true))
+ .WriteTo.Logger(lc => lc
+ .Filter.ByIncludingOnly(e => e.Properties.TryGetValue("SourceContext", out var sc) && sc is ScalarValue sv && sv.Value?.ToString() == "鍒嗗鏌滅數鑺煡璇�")
+ .WriteTo.File(
+ "logs/鍒嗗鏌滅數鑺煡璇�-.log",
+ outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}",
+ rollingInterval: RollingInterval.Day,
+ retainedFileCountLimit: 30,
+ fileSizeLimitBytes: 10 * 1024 * 1024,
+ shared: true))
// 6. 鍙�夛細杈撳嚭鍒癝eq鏃ュ織鏈嶅姟鍣紙缁撴瀯鍖栨棩蹇楁湇鍔″櫒锛�
// 闇�瑕佸畨瑁� Serilog.Sinks.Seq NuGet鍖咃紝骞剁‘淇漇eq鏈嶅姟鍦� http://localhost:5341 杩愯
// 濡備笉闇�瑕丼eq鏃ュ織锛屾敞閲婃帀涓嬫柟浠g爜鍗冲彲
@@ -95,7 +134,6 @@
builder.Services.AddSwaggerSetup();
builder.Services.AddHttpContextSetup();
-
builder.Services.AddMvc(options =>
{
@@ -137,7 +175,6 @@
builder.Services.Replace(ServiceDescriptor.Transient<IControllerActivator, ServiceBasedControllerActivator>());
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
-
var app = builder.Build();
// 3. 閰嶇疆涓棿浠�
@@ -154,7 +191,6 @@
app.UseApiLogMiddleware();
// todo
// app.UseRecordAccessLogsMiddle();
-
DefaultFilesOptions defaultFilesOptions = new DefaultFilesOptions();
defaultFilesOptions.DefaultFileNames.Clear();
@@ -182,4 +218,4 @@
app.MapHub<WIDESEA_WMSServer.Hubs.StockHub>("/stockHub");
-app.Run();
+app.Run();
\ No newline at end of file
--
Gitblit v1.9.3