aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper/LogAction.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/helper/LogAction.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/helper/LogAction.java')
-rw-r--r--src/org/traccar/helper/LogAction.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/org/traccar/helper/LogAction.java b/src/org/traccar/helper/LogAction.java
index 2f575537d..db13337b8 100644
--- a/src/org/traccar/helper/LogAction.java
+++ b/src/org/traccar/helper/LogAction.java
@@ -18,10 +18,14 @@ package org.traccar.helper;
import java.beans.Introspector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.traccar.model.BaseModel;
public final class LogAction {
+ private static final Logger LOGGER = LoggerFactory.getLogger(LogAction.class);
+
private LogAction() {
}
@@ -71,26 +75,25 @@ public final class LogAction {
}
public static void resetDeviceAccumulators(long userId, long deviceId) {
- log(String.format(PATTERN_DEVICE_ACCUMULATORS, userId, ACTION_DEVICE_ACCUMULATORS, deviceId));
+ LOGGER.info(String.format(
+ PATTERN_DEVICE_ACCUMULATORS, userId, ACTION_DEVICE_ACCUMULATORS, deviceId));
}
private static void logObjectAction(String action, long userId, Class<?> clazz, long objectId) {
- log(String.format(PATTERN_OBJECT, userId, action, Introspector.decapitalize(clazz.getSimpleName()), objectId));
+ LOGGER.info(String.format(
+ PATTERN_OBJECT, userId, action, Introspector.decapitalize(clazz.getSimpleName()), objectId));
}
private static void logLinkAction(String action, long userId,
Class<?> owner, long ownerId, Class<?> property, long propertyId) {
- log(String.format(PATTERN_LINK, userId, action,
+ LOGGER.info(String.format(
+ PATTERN_LINK, userId, action,
Introspector.decapitalize(owner.getSimpleName()), ownerId,
Introspector.decapitalize(property.getSimpleName()), propertyId));
}
private static void logLoginAction(String action, long userId) {
- log(String.format(PATTERN_LOGIN, userId, action));
- }
-
- private static void log(String msg) {
- Log.info(msg);
+ LOGGER.info(String.format(PATTERN_LOGIN, userId, action));
}
}