aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper/LogAction.java
diff options
context:
space:
mode:
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));
}
}