mirror of
https://github.com/Radarr/Radarr
synced 2024-12-24 17:01:38 +00:00
Upgrade log files are now date stamped (no longer overwritten)
This commit is contained in:
parent
d73853f08b
commit
ff8d837380
1 changed files with 8 additions and 9 deletions
|
@ -54,16 +54,15 @@ private static void InitLoggers()
|
||||||
LogConfiguration.RegisterUdpLogger();
|
LogConfiguration.RegisterUdpLogger();
|
||||||
LogConfiguration.RegisterExceptioneer();
|
LogConfiguration.RegisterExceptioneer();
|
||||||
|
|
||||||
var fileTarget = new FileTarget();
|
var lastUpgradeLog = new FileTarget();
|
||||||
fileTarget.AutoFlush = true;
|
lastUpgradeLog.AutoFlush = true;
|
||||||
fileTarget.ConcurrentWrites = false;
|
lastUpgradeLog.ConcurrentWrites = false;
|
||||||
fileTarget.DeleteOldFileOnStartup = true;
|
lastUpgradeLog.FileName = Path.Combine("UpgradeLog", DateTime.Now.ToString("yyyy.MM.dd-H-mm") + ".txt");
|
||||||
fileTarget.FileName = "upgrade.log";
|
lastUpgradeLog.KeepFileOpen = false;
|
||||||
fileTarget.KeepFileOpen = false;
|
lastUpgradeLog.Layout = "${longdate} - ${logger}: ${message} ${exception}";
|
||||||
|
|
||||||
fileTarget.Layout = "${logger}: ${message} ${exception}";
|
LogManager.Configuration.AddTarget(lastUpgradeLog.GetType().Name, lastUpgradeLog);
|
||||||
LogManager.Configuration.AddTarget(fileTarget.GetType().Name, fileTarget);
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, lastUpgradeLog));
|
||||||
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, fileTarget));
|
|
||||||
|
|
||||||
LogConfiguration.Reload();
|
LogConfiguration.Reload();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue