aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-05-30 01:01:07 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-05-30 01:01:07 +1200
commit54d9f0a3267fd8cef28c7fb70aba0a445bd820f6 (patch)
tree3263a8d872c90a322ff67930e9a48cdc7c06878b
parent72b24000aa91d9af69c30c1648f65b06c2511405 (diff)
downloadtraccar-server-54d9f0a3267fd8cef28c7fb70aba0a445bd820f6.tar.gz
traccar-server-54d9f0a3267fd8cef28c7fb70aba0a445bd820f6.tar.bz2
traccar-server-54d9f0a3267fd8cef28c7fb70aba0a445bd820f6.zip
Log database clear event (fix #3198)
-rw-r--r--src/org/traccar/database/DataManager.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 840a8931c..dd65289e4 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -20,6 +20,7 @@ import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.sql.SQLException;
+import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
@@ -316,6 +317,7 @@ public class DataManager {
long historyDays = config.getInteger("database.historyDays");
if (historyDays != 0) {
Date timeLimit = new Date(System.currentTimeMillis() - historyDays * 24 * 3600 * 1000);
+ Log.debug("Clearing history earlier than " + new SimpleDateFormat(Log.DATE_FORMAT).format(timeLimit));
QueryBuilder.create(dataSource, getQuery("database.deletePositions"))
.setDate("serverTime", timeLimit)
.executeUpdate();