From 13563221ad5aa99216a1e742c964fce49fed7187 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 18 Oct 2014 20:49:12 +1300 Subject: Add default log appender (fix #931) --- src/org/traccar/helper/Log.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/org/traccar/helper/Log.java b/src/org/traccar/helper/Log.java index 7d8d24c21..648d4803f 100644 --- a/src/org/traccar/helper/Log.java +++ b/src/org/traccar/helper/Log.java @@ -28,6 +28,7 @@ import org.apache.log4j.Level; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; +import org.apache.log4j.varia.NullAppender; import org.jboss.netty.logging.AbstractInternalLogger; import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLoggerFactory; @@ -46,6 +47,8 @@ public class Log { layout, properties.getProperty("logger.file"), "'.'yyyyMMdd"); LogManager.resetConfiguration(); + LogManager.getRootLogger().addAppender(new NullAppender()); + logger = Logger.getLogger(LOGGER_NAME); logger.addAppender(appender); logger.setLevel(Level.toLevel(properties.getProperty("logger.level"), Level.ALL)); -- cgit v1.2.3