From 28f929ae666cb40fd87a8920bd8069d27146e174 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 7 Jan 2021 00:19:55 -0500 Subject: [PATCH] Add the server port to the log file names --- MultiAdmin/Server.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/MultiAdmin/Server.cs b/MultiAdmin/Server.cs index ee03c5f..720eee6 100644 --- a/MultiAdmin/Server.cs +++ b/MultiAdmin/Server.cs @@ -28,11 +28,13 @@ public class Server public readonly string serverId; public readonly string configLocation; - public readonly uint? port; + private readonly uint? port; public readonly string[] args; public readonly string serverDir; public readonly string logDir; + public uint Port => port ?? ServerConfig.Port.Value; + private DateTime initStopTimeoutTime; private DateTime initRestartTimeoutTime; @@ -129,7 +131,7 @@ private set // Update related variables LogDirFile = string.IsNullOrEmpty(value) || string.IsNullOrEmpty(logDir) ? null - : $"{Path.Combine(logDir, value)}_{{0}}_output_log.txt"; + : $"{Path.Combine(logDir, value)}_{{0}}_log_{Port}.txt"; lock (this) { @@ -309,7 +311,7 @@ public void StartServer(bool restartOnCrash = true) "-nodedicateddelete", $"-id{Process.GetCurrentProcess().Id}", $"-console{consoleSocket.Port}", - $"-port{port ?? ServerConfig.Port.Value}" + $"-port{Port}" }; if (string.IsNullOrEmpty(ScpLogFile) || ServerConfig.NoLog.Value)