diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2011-06-16 08:18:30 +0000 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2011-06-16 08:18:30 +0000 |
commit | e71d3a6b1ee198a3c0c99b354e111663dedf84e7 (patch) | |
tree | 32d1b60e9fd65dd2bba9b3fd71ea5e53a7c99e49 /src/net/sourceforge | |
parent | 7bc80dc78894b2cbe241fcaea2838673150fcef1 (diff) | |
download | traccar-server-e71d3a6b1ee198a3c0c99b354e111663dedf84e7.tar.gz traccar-server-e71d3a6b1ee198a3c0c99b354e111663dedf84e7.tar.bz2 traccar-server-e71d3a6b1ee198a3c0c99b354e111663dedf84e7.zip |
Diffstat (limited to 'src/net/sourceforge')
-rw-r--r-- | src/net/sourceforge/opentracking/Server.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/net/sourceforge/opentracking/Server.java b/src/net/sourceforge/opentracking/Server.java index 18194b3e6..b34e4cf46 100644 --- a/src/net/sourceforge/opentracking/Server.java +++ b/src/net/sourceforge/opentracking/Server.java @@ -26,6 +26,9 @@ import java.sql.DriverManager; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.logging.Logger; import java.util.logging.FileHandler; import java.util.logging.Formatter; @@ -181,7 +184,7 @@ public class Server implements DataManager { insertPosition.executeUpdate(); } - + /** * Init logger */ @@ -200,9 +203,16 @@ public class Server implements DataManager { file.setFormatter(new Formatter() { private final String LINE_SEPARATOR = System.getProperty("line.separator", "\n"); + + private final DateFormat dateFormat = + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); public String format(LogRecord record) { - return record.getMessage().concat(LINE_SEPARATOR); + String line = dateFormat.format(new Date(record.getMillis())); + line += " - "; + line += formatMessage(record); + line += LINE_SEPARATOR; + return line; } }); |