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

pull/6/head
Mark McDowall 10 years ago
parent 1837ba94cc
commit e58576bcfa

@ -28,10 +28,13 @@ namespace NzbDrone.Core.Instrumentation
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));
SetMinimumLogLevel(consoleLoggerRule, minimumLogLevel);
if (consoleLoggerRule != null)
{
consoleLoggerRule.EnableLoggingForLevel(LogLevel.Trace);
SetMinimumLogLevel(consoleLoggerRule, minimumLogLevel);
}
//Log Files
var rollingFileLoggerRule = rules.Single(s => s.Targets.Any(t => t is NzbDroneFileTarget));

Loading…
Cancel
Save