aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DataManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-14 14:33:49 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-14 14:33:49 +1200
commitb10824bb5769c4abb93e3451673b88efdfb9d467 (patch)
treec4d04ed2f19d5758a75b702467dbc051c5d0511c /src/org/traccar/database/DataManager.java
parente331573c0df7467fd36ae3eba3c259ed9b1d9253 (diff)
downloadtrackermap-server-b10824bb5769c4abb93e3451673b88efdfb9d467.tar.gz
trackermap-server-b10824bb5769c4abb93e3451673b88efdfb9d467.tar.bz2
trackermap-server-b10824bb5769c4abb93e3451673b88efdfb9d467.zip
Log using slf4j and java logging
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r--src/org/traccar/database/DataManager.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 06dd26b17..71db329bc 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -39,9 +39,10 @@ import liquibase.exception.LiquibaseException;
import liquibase.resource.FileSystemResourceAccessor;
import liquibase.resource.ResourceAccessor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.traccar.Config;
import org.traccar.Context;
-import org.traccar.helper.Log;
import org.traccar.model.Attribute;
import org.traccar.model.Device;
import org.traccar.model.Driver;
@@ -65,6 +66,8 @@ import com.zaxxer.hikari.HikariDataSource;
public class DataManager {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DataManager.class);
+
public static final String ACTION_SELECT_ALL = "selectAll";
public static final String ACTION_SELECT = "select";
public static final String ACTION_INSERT = "insert";
@@ -209,7 +212,7 @@ public class DataManager {
private String getQuery(String key) {
String query = config.getString(key);
if (query == null) {
- Log.info("Query not provided: " + key);
+ LOGGER.info("Query not provided: " + key);
}
return query;
}
@@ -234,7 +237,7 @@ public class DataManager {
query = constructObjectQuery(action, clazz, extended);
config.setString(queryName, query);
} else {
- Log.info("Query not provided: " + queryName);
+ LOGGER.info("Query not provided: " + queryName);
}
}
@@ -261,7 +264,7 @@ public class DataManager {
property.equals(User.class) ? ManagedUser.class : property);
config.setString(queryName, query);
} else {
- Log.info("Query not provided: " + queryName);
+ LOGGER.info("Query not provided: " + queryName);
}
}
@@ -358,7 +361,8 @@ 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));
+ LOGGER.debug(
+ "Clearing history earlier than " + new SimpleDateFormat(Context.DATE_FORMAT).format(timeLimit));
QueryBuilder.create(dataSource, getQuery("database.deletePositions"))
.setDate("serverTime", timeLimit)
.executeUpdate();