XFEExtension.NetCore.ServerInteractive
[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/ServerService/ServerExceptionProcessService.cs
+0
-4
Modified
XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/ServerService/ServerIpInitializer.cs
+0
-1
Modified
XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/ServerService/ServerLogInitializer.cs
+1
-0
Modified
XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/ServerService/XFECoreServerProcessService.cs
+1
-13
Modified
XFEExtension.NetCore.ServerInteractive/XFEExtension.NetCore.ServerInteractive.csproj
+5
-8
XFEstudio/XFEExtension.NetCore.ServerInteractive
优化日志管理逻辑,调整保存与加载流程
本次提交移除了服务器关闭、重启和异常处理时自动保存日志的代码,将日志保存路径的设置提前至初始化阶段,并简化了日志文件加载流程。同步清理了无用命名空间引用,项目版本号升级为1.1.11。
30e8824
代码差异
5 个文件
+7
-26
@@ -18,9 +18,6 @@ public class ServerExceptionProcessService : ServerServiceBase
18
18
void CurrentDomain_ProcessExit(object? sender, EventArgs e)
19
19
{
20
20
Console.WriteLine("[DEBUG]正在关闭服务器...");
21
Console.WriteLine("[DEBUG]正在保存日志...");
22
XFEConsole.XFEConsole.Log.Export().WriteIn("server.log");
23
Console.WriteLine("[DEBUG]日志已保存!");
24
21
Console.WriteLine("[DEBUG]服务器已关闭!");
25
22
}
26
23
@@ -29,6 +26,5 @@ public class ServerExceptionProcessService : ServerServiceBase
29
26
Console.WriteLine($"[FATAL]{e.ExceptionObject}");
30
27
if (e.ExceptionObject is Exception exception)
31
28
Console.WriteLine($"[TRACE]{exception.StackTrace}");
32
XFEConsole.XFEConsole.Log.Export().WriteIn("server.log");
33
29
}
34
30
}
@@ -1,7 +1,6 @@
1
1
using XFEExtension.NetCore.ServerInteractive.Implements.ServerService;
2
2
using XFEExtension.NetCore.ServerInteractive.Profiles;
3
3
using XFEExtension.NetCore.StringExtension;
4
using XFEExtension.NetCore.XFEConsole;
5
4
6
5
namespace XFEExtension.NetCore.ServerInteractive.Utilities.Server.Services.ServerService;
7
6
@@ -11,5 +11,6 @@ public class ServerLogInitializer : ServerInitializerServiceBase
11
11
public override void Initialize()
12
12
{
13
13
XFEConsole.XFEConsole.UseXFEConsoleLog();
14
XFEConsole.XFEConsole.Log.LogPath = "server.log";
14
15
}
15
16
}
@@ -15,12 +15,9 @@ public class XFEServerCoreProcessService : ServerCoreProcessServiceBase
15
15
{
16
16
try
17
17
{
18
XFEConsole.XFEConsole.Log.Clear();
19
Console.WriteLine($"[DEBUG]加载日志文件...");
20
18
if (File.Exists("server.log"))
21
19
{
22
XFEConsole.XFEConsole.Log.Import("server.log".ReadOut()!);
23
Console.WriteLine($"[DEBUG]成功加载{XFEConsole.XFEConsole.Log.Logs.Count}条日志!");
20
Console.WriteLine("[DEBUG]找到日志文件!");
24
21
}
25
22
else
26
23
{
@@ -45,9 +42,6 @@ public class XFEServerCoreProcessService : ServerCoreProcessServiceBase
45
42
Console.WriteLine("[DEBUG]正在重启服务器({serverCoreService.ServerCoreName}) 2...");
46
43
await Task.Delay(1000);
47
44
Console.WriteLine("[DEBUG]正在重启服务器({serverCoreService.ServerCoreName}) 1...");
48
Console.WriteLine("[DEBUG]正在保存日志...");
49
XFEConsole.XFEConsole.Log.Export().WriteIn("server.log");
50
Console.WriteLine("[DEBUG]日志已保存!");
51
45
}
52
46
catch (Exception ex)
53
47
{
@@ -60,9 +54,6 @@ public class XFEServerCoreProcessService : ServerCoreProcessServiceBase
60
54
Console.WriteLine($"[DEBUG]正在重启服务器({serverCoreService.ServerCoreName}) 2...");
61
55
await Task.Delay(1000);
62
56
Console.WriteLine($"[DEBUG]正在重启服务器({serverCoreService.ServerCoreName}) 1...");
63
Console.WriteLine("[DEBUG]正在保存日志...");
64
XFEConsole.XFEConsole.Log.Export().WriteIn("server.log");
65
Console.WriteLine("[DEBUG]日志已保存!");
66
57
}
67
58
}
68
59
}));
@@ -81,9 +72,6 @@ public class XFEServerCoreProcessService : ServerCoreProcessServiceBase
81
72
Console.WriteLine("[DEBUG]正在重启服务器 2...");
82
73
await Task.Delay(1000);
83
74
Console.WriteLine("[DEBUG]正在重启服务器 1...");
84
Console.WriteLine("[DEBUG]正在保存日志...");
85
XFEConsole.XFEConsole.Log.Export().WriteIn("server.log");
86
Console.WriteLine("[DEBUG]日志已保存!");
87
75
}
88
76
}
89
77
}
@@ -5,7 +5,7 @@
5
5
<ImplicitUsings>enable</ImplicitUsings>
6
6
<Nullable>enable</Nullable>
7
7
<GenerateDocumentationFile>True</GenerateDocumentationFile>
8
<Version>1.1.10</Version>
8
<Version>1.1.11</Version>
9
9
<Title>XFEExtension.NetCore.ServerInteractive</Title>
10
10
<RepositoryUrl>https://github.com/XFEstudio/XFEExtension.NetCore.ServerInteractive</RepositoryUrl>
11
11
<AnalysisLevel>latest</AnalysisLevel>
@@ -20,14 +20,11 @@
20
20
<PackageTags>XFE;Server;服务器;XFEExtension</PackageTags>
21
21
<PackageReleaseNotes>
22
22
## 调整
23
24
优化日志管理逻辑,调整保存与加载流程
23
25
24
并发测试优化,日志增强及配置保存改进
25
26
本次提交包括以下更新:
27
- 日志输出增加服务核心名称,提升调试可读性;
28
- 日志加载输出格式优化;
29
- 服务初始化时自动保存配置文件,增强可靠性。
30
26
本次提交移除了服务器关闭、重启和异常处理时自动保存日志的代码,将日志保存路径的设置提前至初始化阶段,并简化了日志文件加载流程。
27
同步清理了无用命名空间引用,项目版本号升级为1.1.11。
31
28
32
29
## 新增
33
30