mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
add console logging during startup
This commit is contained in:
@@ -187,7 +187,7 @@ namespace MediaBrowser.Common.Implementations.Logging
|
||||
LogFilePath = Path.Combine(LogDirectory, LogFilePrefix + "-" + decimal.Round(DateTime.Now.Ticks / 10000000) + ".log");
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(LogFilePath));
|
||||
|
||||
|
||||
AddFileTarget(LogFilePath, level);
|
||||
|
||||
LogSeverity = level;
|
||||
@@ -212,5 +212,26 @@ namespace MediaBrowser.Common.Implementations.Logging
|
||||
{
|
||||
LogManager.Flush();
|
||||
}
|
||||
|
||||
|
||||
public void AddConsoleOutput()
|
||||
{
|
||||
var target = new ConsoleTarget()
|
||||
{
|
||||
Layout = "${level}, ${logger}, ${message}",
|
||||
Error = false
|
||||
};
|
||||
|
||||
RemoveTarget("ConsoleTarget");
|
||||
|
||||
target.Name = "ConsoleTarget";
|
||||
|
||||
AddLogTarget(target, LogSeverity);
|
||||
}
|
||||
|
||||
public void RemoveConsoleOutput()
|
||||
{
|
||||
RemoveTarget("ConsoleTarget");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user