aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-12 17:54:00 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-12 17:54:00 +1200
commita2dac324574dde8fe8e57bd46dd7f94d0fb60231 (patch)
tree061e957cb53e00214a33acb6317be9c0849c50fa /src/org/traccar/helper
parentf1ae2d73584d4ddded6f727c665d97f03ecf9c25 (diff)
downloadtraccar-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.tar.gz
traccar-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.tar.bz2
traccar-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.zip
Re-factor configuration access
Diffstat (limited to 'src/org/traccar/helper')
-rw-r--r--src/org/traccar/helper/Log.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/helper/Log.java b/src/org/traccar/helper/Log.java
index 6ae46163b..e4b0168a9 100644
--- a/src/org/traccar/helper/Log.java
+++ b/src/org/traccar/helper/Log.java
@@ -20,7 +20,6 @@ import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import java.lang.management.OperatingSystemMXBean;
import java.lang.management.RuntimeMXBean;
-import java.util.Properties;
import org.apache.log4j.Appender;
import org.apache.log4j.DailyRollingFileAppender;
import org.apache.log4j.Layout;
@@ -32,6 +31,7 @@ import org.apache.log4j.varia.NullAppender;
import org.jboss.netty.logging.AbstractInternalLogger;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
+import org.traccar.Config;
public class Log {
@@ -42,19 +42,19 @@ public class Log {
private static Logger logger = null;
- public static void setupLogger(Properties properties) throws IOException {
+ public static void setupLogger(Config config) throws IOException {
Layout layout = new PatternLayout("%d{yyyy-MM-dd HH:mm:ss} %5p: %m%n");
Appender appender = new DailyRollingFileAppender(
- layout, properties.getProperty("logger.file"), "'.'yyyyMMdd");
+ layout, config.getString("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));
+ logger.setLevel(Level.toLevel(config.getString("logger.level"), Level.ALL));
// Workaround for "Bug 745866 - (EDG-45) Possible netty logging config problem"
InternalLoggerFactory.setDefaultFactory(new InternalLoggerFactory() {