From 54d9f0a3267fd8cef28c7fb70aba0a445bd820f6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 30 May 2017 01:01:07 +1200 Subject: Log database clear event (fix #3198) --- src/org/traccar/database/DataManager.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/org/traccar') 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(); -- cgit v1.2.3