Table of Contents

Class ConsoleLogService

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Persists every server's console output to a shared, dated log file (%APPDATA%/McServerLauncher/logs/launcher-yyyy-MM-dd.log) so the history survives the app being closed or crashing, not just the in-memory console shown in the UI. A new file starts each day; files older than McServerLauncher.Services.ConsoleLogService.RetentionDays are pruned so the folder doesn't grow forever.

public sealed class ConsoleLogService
Inheritance
ConsoleLogService
Inherited Members

Fields

Shared

Single shared instance: the log file is one per day for the whole app, not per server.

public static readonly ConsoleLogService Shared

Field Value

ConsoleLogService

Methods

Flush()

Forces buffered lines to disk. Called periodically and on clean shutdown.

public void Flush()

Log(string, string)

Appends one line, timestamped and tagged with the server's name, to today's log file.

public void Log(string serverName, string line)

Parameters

serverName string
line string