1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

Don't try to set console logging when its not enabled

This commit is contained in:
Mark McDowall 2015-02-19 09:18:41 -08:00
parent 1837ba94cc
commit e58576bcfa

View File

@ -28,10 +28,13 @@ public void Reconfigure()
var rules = LogManager.Configuration.LoggingRules;
//Console
var consoleLoggerRule = rules.Single(s => s.Targets.Any(t => t is ColoredConsoleTarget));
consoleLoggerRule.EnableLoggingForLevel(LogLevel.Trace);
var consoleLoggerRule = rules.SingleOrDefault(s => s.Targets.Any(t => t is ColoredConsoleTarget));
if (consoleLoggerRule != null)
{
consoleLoggerRule.EnableLoggingForLevel(LogLevel.Trace);
SetMinimumLogLevel(consoleLoggerRule, minimumLogLevel);
}
//Log Files
var rollingFileLoggerRule = rules.Single(s => s.Targets.Any(t => t is NzbDroneFileTarget));