aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Server.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/Server.java')
-rw-r--r--src/org/traccar/Server.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java
index 654d32321..cbcb68324 100644
--- a/src/org/traccar/Server.java
+++ b/src/org/traccar/Server.java
@@ -30,6 +30,7 @@ import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.jboss.netty.handler.codec.string.StringEncoder;
+import org.traccar.helper.Log;
import org.traccar.http.WebServer;
import org.traccar.model.DataManager;
import org.traccar.model.DatabaseDataManager;
@@ -132,12 +133,12 @@ public class Server {
if (loggerEnabled) {
- Logger logger = Logger.getLogger("logger");
String fileName = properties.getProperty("logger.file");
if (fileName != null) {
FileHandler file = new FileHandler(fileName, true);
+ // Simple formatter
file.setFormatter(new Formatter() {
private final String LINE_SEPARATOR =
System.getProperty("line.separator", "\n");
@@ -147,15 +148,16 @@ public class Server {
public String format(LogRecord record) {
String line = dateFormat.format(new Date(record.getMillis()));
- line += " - ";
+ line += " " + record.getLevel().getName() + ": ";
line += formatMessage(record);
line += LINE_SEPARATOR;
return line;
}
});
- logger.setLevel(Level.ALL);
- logger.addHandler(file);
+ // NOTE: Console logger level will remain INFO
+ Log.getLogger().setLevel(Level.ALL);
+ Log.getLogger().addHandler(file);
}
}
}