aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/TrackerEventHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-07-30 20:42:02 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-07-30 20:42:02 +1200
commit110c49504f87c025423c923500bd52ea4615b33b (patch)
tree2398fd3fa3286b35b6f80cad51b59703d3065b6e /src/org/traccar/TrackerEventHandler.java
parent5f75f109dfc1140d2f644857d877baf88cb1fe83 (diff)
downloadtrackermap-server-110c49504f87c025423c923500bd52ea4615b33b.tar.gz
trackermap-server-110c49504f87c025423c923500bd52ea4615b33b.tar.bz2
trackermap-server-110c49504f87c025423c923500bd52ea4615b33b.zip
Improve logging system (fix #278)
Diffstat (limited to 'src/org/traccar/TrackerEventHandler.java')
-rw-r--r--src/org/traccar/TrackerEventHandler.java22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/org/traccar/TrackerEventHandler.java b/src/org/traccar/TrackerEventHandler.java
index 538e71cdf..6deeaad9b 100644
--- a/src/org/traccar/TrackerEventHandler.java
+++ b/src/org/traccar/TrackerEventHandler.java
@@ -41,19 +41,14 @@ public class TrackerEventHandler extends IdleStateAwareChannelHandler {
private void processSinglePosition(Position position) {
if (position == null) {
- Log.info("null message");
+ Log.info("processSinglePosition null message");
} else {
- Log.info(
- "id: " + position.getId() +
- ", deviceId: " + position.getDeviceId() +
- ", valid: " + position.getValid() +
- ", time: " + position.getTime() +
- ", latitude: " + position.getLatitude() +
- ", longitude: " + position.getLongitude() +
- ", altitude: " + position.getAltitude() +
- ", speed: " + position.getSpeed() +
- ", course: " + position.getCourse() +
- ", power: " + position.getPower());
+ StringBuilder s = new StringBuilder();
+ s.append("device: ").append(position.getDeviceId()).append(", ");
+ s.append("time: ").append(position.getTime()).append(", ");
+ s.append("lat: ").append(position.getLatitude()).append(", ");
+ s.append("lon: ").append(position.getLongitude());
+ Log.info(s.toString());
}
// Write position to database
@@ -63,8 +58,7 @@ public class TrackerEventHandler extends IdleStateAwareChannelHandler {
dataManager.updateLatestPosition(position.getDeviceId(), id);
}
} catch (Exception error) {
- Log.info("Exception during query execution");
- Log.warning(error.getMessage());
+ Log.warning(error);
}
}