From 58e829a30021e30d51e09fd085d16f6a701b6d98 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 18 Dec 2012 22:48:42 +1300 Subject: Fix logger --- src/org/traccar/helper/Log.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/helper') diff --git a/src/org/traccar/helper/Log.java b/src/org/traccar/helper/Log.java index 03de36c46..983171b72 100644 --- a/src/org/traccar/helper/Log.java +++ b/src/org/traccar/helper/Log.java @@ -23,13 +23,20 @@ import java.util.logging.Logger; */ public class Log { - private static String TRACCAR_LOGGER_NAME = "traccar"; + private static final String TRACCAR_LOGGER_NAME = "traccar"; + + private static Logger logger = null; /** * Return global logger */ public static Logger getLogger() { - return Logger.getLogger(TRACCAR_LOGGER_NAME); + if (logger == null) { + logger = Logger.getLogger(TRACCAR_LOGGER_NAME); + logger.setUseParentHandlers(false); + logger.setLevel(Level.ALL); + } + return logger; } private static void write(Level level, String msg) { -- cgit v1.2.3