diff options
author | Leo Sadovsky <lsadovski@oboz.com> | 2023-01-26 20:34:12 +0300 |
---|---|---|
committer | Leo Sadovsky <lsadovski@oboz.com> | 2023-01-26 20:34:12 +0300 |
commit | 1d0d5661ca921a08217f23d4889f530643327847 (patch) | |
tree | 4578ba236f4022c578b787f271827d79c1919296 | |
parent | b4934e05aab6c875cd1c2d412102e041a79b9210 (diff) | |
download | trackermap-server-1d0d5661ca921a08217f23d4889f530643327847.tar.gz trackermap-server-1d0d5661ca921a08217f23d4889f530643327847.tar.bz2 trackermap-server-1d0d5661ca921a08217f23d4889f530643327847.zip |
worked out the review comments: code formatting and naming issues
-rw-r--r-- | setup/default.xml | 1 | ||||
-rw-r--r-- | src/main/java/org/traccar/config/Keys.java | 1 | ||||
-rw-r--r-- | src/main/java/org/traccar/helper/Log.java | 8 |
3 files changed, 3 insertions, 7 deletions
diff --git a/setup/default.xml b/setup/default.xml index f2ca45fc3..c00d29384 100644 --- a/setup/default.xml +++ b/setup/default.xml @@ -24,7 +24,6 @@ <entry key='logger.level'>info</entry> <entry key='logger.file'>./logs/tracker-server.log</entry> <entry key='logger.rotate'>true</entry> - <entry key='logger.rotate.interval'>day</entry> <entry key='filter.enable'>true</entry> <entry key='filter.future'>86400</entry> diff --git a/src/main/java/org/traccar/config/Keys.java b/src/main/java/org/traccar/config/Keys.java index 19e4540ee..093f4298c 100644 --- a/src/main/java/org/traccar/config/Keys.java +++ b/src/main/java/org/traccar/config/Keys.java @@ -1584,7 +1584,6 @@ public final class Keys { List.of(KeyType.CONFIG), "day"); - /** * A list of position attributes to log. */ diff --git a/src/main/java/org/traccar/helper/Log.java b/src/main/java/org/traccar/helper/Log.java index a8bf66827..9aaf1cfd3 100644 --- a/src/main/java/org/traccar/helper/Log.java +++ b/src/main/java/org/traccar/helper/Log.java @@ -55,23 +55,21 @@ public final class Log { private String suffix; private Writer writer; private final boolean rotate; - - private final String logFileSuffix; + private final String template; RollingFileHandler(String name, boolean rotate, String rotateInterval) { this.name = name; this.rotate = rotate; - this.logFileSuffix = rotateInterval.equalsIgnoreCase("HOUR") ? "yyyyMMddHH" : "yyyyMMdd"; + this.template = rotateInterval.equalsIgnoreCase("HOUR") ? "yyyyMMddHH" : "yyyyMMdd"; } - @Override public synchronized void publish(LogRecord record) { if (isLoggable(record)) { try { String suffix = ""; if (rotate) { - suffix = new SimpleDateFormat(this.logFileSuffix).format(new Date(record.getMillis())); + suffix = new SimpleDateFormat(template).format(new Date(record.getMillis())); if (writer != null && !suffix.equals(this.suffix)) { writer.close(); writer = null; |