Fixed npe when missing stdout logger
@@ -17,6 +17,7 @@ package org.kairosdb.core;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Appender;
import ch.qos.logback.core.filter.Filter;
import ch.qos.logback.core.spi.FilterReply;
import com.beust.jcommander.JCommander;
@@ -319,7 +320,10 @@ public class Main
{
//Turn off console logging
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
- root.getAppender("stdout").addFilter(new Filter<ILoggingEvent>()
+ Appender<ILoggingEvent> stdout = root.getAppender("stdout");
+ if (stdout != null)
+ {
+ stdout.addFilter(new Filter<ILoggingEvent>()
{
@Override
public FilterReply decide(ILoggingEvent iLoggingEvent)
@@ -328,6 +332,7 @@ public class Main
}
});
}
+ }
File propertiesFile = null;
if (!StringUtils.isNullOrEmpty(arguments.propertiesFile))
