aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/helper/Log.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-12-29 22:08:33 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-12-29 22:08:33 -0800
commit7f0692101a017f33ffb984e6df92e5dbef6ce71b (patch)
tree7b842f9372a2b07d5fea9d0ceb8762130153183c /src/main/java/org/traccar/helper/Log.java
parentf94951e7e78956b2bbd438665ff290a472afde76 (diff)
downloadtrackermap-server-7f0692101a017f33ffb984e6df92e5dbef6ce71b.tar.gz
trackermap-server-7f0692101a017f33ffb984e6df92e5dbef6ce71b.tar.bz2
trackermap-server-7f0692101a017f33ffb984e6df92e5dbef6ce71b.zip
Migrate logger keys
Diffstat (limited to 'src/main/java/org/traccar/helper/Log.java')
-rw-r--r--src/main/java/org/traccar/helper/Log.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/helper/Log.java b/src/main/java/org/traccar/helper/Log.java
index 358f11a31..8c67f9ddc 100644
--- a/src/main/java/org/traccar/helper/Log.java
+++ b/src/main/java/org/traccar/helper/Log.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2020 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package org.traccar.helper;
import org.traccar.config.Config;
+import org.traccar.config.Keys;
import java.io.BufferedWriter;
import java.io.File;
@@ -46,10 +47,10 @@ public final class Log {
private static class RollingFileHandler extends Handler {
- private String name;
+ private final String name;
private String suffix;
private Writer writer;
- private boolean rotate;
+ private final boolean rotate;
RollingFileHandler(String name, boolean rotate) {
this.name = name;
@@ -110,7 +111,7 @@ public final class Log {
public static class LogFormatter extends Formatter {
- private boolean fullStackTraces;
+ private final boolean fullStackTraces;
LogFormatter(boolean fullStackTraces) {
this.fullStackTraces = fullStackTraces;
@@ -178,11 +179,11 @@ public final class Log {
public static void setupLogger(Config config) {
setupLogger(
- config.getBoolean("logger.console"),
- config.getString("logger.file"),
- config.getString("logger.level"),
- config.getBoolean("logger.fullStackTraces"),
- config.getBoolean("logger.rotate"));
+ config.getBoolean(Keys.LOGGER_CONSOLE),
+ config.getString(Keys.LOGGER_FILE),
+ config.getString(Keys.LOGGER_LEVEL),
+ config.getBoolean(Keys.LOGGER_FULL_STACK_TRACES),
+ config.getBoolean(Keys.LOGGER_ROTATE));
}
private static void setupLogger(