diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 32d6aa977..ecb3447bd 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -48,18 +48,6 @@ if (string.IsNullOrWhiteSpace(enviromentName)) : "Development"; } -if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) -{ - Log.Logger.Warning($"当前部署平台环境:windows"); -} -else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) -{ - Log.Logger.Warning($"当前部署平台环境:linux"); -} -else -{ - Log.Logger.Warning($"当前部署平台环境:OSX or FreeBSD"); -} NewId.SetProcessIdProvider(new CurrentProcessIdProvider()); @@ -248,7 +236,6 @@ app.UseEndpoints(endpoints => // Serilog SerilogExtension.AddSerilogSetup(enviromentName, app.Services); -Log.Logger.Warning($"当前环境:{enviromentName}"); var hangfireJobService = app.Services.GetRequiredService(); @@ -259,8 +246,31 @@ await hangfireJobService.InitHangfireJobTaskAsync(); try { + #region 运行环境 部署平台 + + Log.Logger.Warning($"当前环境:{enviromentName}"); + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + Log.Logger.Warning($"当前部署平台环境:windows"); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Log.Logger.Warning($"当前部署平台环境:linux"); + } + else + { + Log.Logger.Warning($"当前部署平台环境:OSX or FreeBSD"); + } + + #endregion + + app.Run(); + + + } catch (Exception e) {