mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Nzbdrone.exe file logging
This commit is contained in:
parent
d3f6c685cd
commit
9be08b810e
4 changed files with 42 additions and 12 deletions
|
@ -62,20 +62,14 @@ namespace NzbDrone.Update
|
|||
|
||||
private static void InitLoggers()
|
||||
{
|
||||
LogConfiguration.RegisterExceptioneer();
|
||||
|
||||
LogConfiguration.RegisterConsoleLogger(LogLevel.Trace);
|
||||
LogConfiguration.RegisterUdpLogger();
|
||||
|
||||
var lastUpgradeLog = new FileTarget();
|
||||
lastUpgradeLog.AutoFlush = true;
|
||||
lastUpgradeLog.ConcurrentWrites = false;
|
||||
lastUpgradeLog.FileName = Path.Combine(new EnviromentProvider().GetSandboxLogFolder(), DateTime.Now.ToString("yyyy.MM.dd-H-mm") + ".txt");
|
||||
lastUpgradeLog.KeepFileOpen = false;
|
||||
lastUpgradeLog.Layout = "${longdate} - ${logger}: ${message} ${exception:format=ToString}";
|
||||
|
||||
LogManager.Configuration.AddTarget(lastUpgradeLog.GetType().Name, lastUpgradeLog);
|
||||
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, lastUpgradeLog));
|
||||
|
||||
LogConfiguration.RegisterExceptioneer();
|
||||
var logPath = Path.Combine(new EnviromentProvider().GetSandboxLogFolder(), DateTime.Now.ToString("yyyy.MM.dd-H-mm") + ".txt");
|
||||
LogConfiguration.RegisterFileLogger(logPath);
|
||||
|
||||
LogConfiguration.Reload();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue