aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Server.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-05-29 23:27:46 +0400
committerAnton Tananaev <anton.tananaev@gmail.com>2012-05-29 23:27:46 +0400
commit3b61199ca03a602514457cf7ed640ff6d9a39519 (patch)
tree14099d0648a01f5dc4299894df0fe232ff4870cb /src/org/traccar/Server.java
parentbf8177e17e6ce607e60fe6e43ecf7401af51a03c (diff)
downloadtrackermap-server-3b61199ca03a602514457cf7ed640ff6d9a39519.tar.gz
trackermap-server-3b61199ca03a602514457cf7ed640ff6d9a39519.tar.bz2
trackermap-server-3b61199ca03a602514457cf7ed640ff6d9a39519.zip
fixed #3
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);
}
}
}