aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-23 01:01:22 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-23 01:01:55 +1200
commit3e8cde2edeac00c07ded5298e313d63c4c8c5b6c (patch)
treea31143cb1f82758a66a3c4b3ab57b2300cc52fb9 /src
parentb1eba6d44bb3940e9920149df0703ebd8e8afcf1 (diff)
downloadtraccar-server-3e8cde2edeac00c07ded5298e313d63c4c8c5b6c.tar.gz
traccar-server-3e8cde2edeac00c07ded5298e313d63c4c8c5b6c.tar.bz2
traccar-server-3e8cde2edeac00c07ded5298e313d63c4c8c5b6c.zip
Print unique id in the log file
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/MainEventHandler.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/MainEventHandler.java b/src/org/traccar/MainEventHandler.java
index f99765de4..1be20c291 100644
--- a/src/org/traccar/MainEventHandler.java
+++ b/src/org/traccar/MainEventHandler.java
@@ -36,10 +36,12 @@ public class MainEventHandler extends IdleStateAwareChannelHandler {
Position position = (Position) e.getMessage();
+ String uniqueId = Context.getDataManager().getDeviceById(position.getDeviceId()).getUniqueId();
+
// Log position
StringBuilder s = new StringBuilder();
s.append(formatChannel(e.getChannel())).append(" ");
- s.append("id: ").append(position.getDeviceId()).append(", ");
+ s.append("id: ").append(uniqueId).append(", ");
s.append("time: ").append(
new SimpleDateFormat(Log.DATE_FORMAT).format(position.getFixTime())).append(", ");
s.append("lat: ").append(String.format("%.5f", position.getLatitude())).append(", ");