aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-06-01 06:41:11 -0700
committerAnton Tananaev <anton@traccar.org>2024-06-01 06:41:17 -0700
commit78770c3ddc9f0073e1993e6a635e2f469d940216 (patch)
tree0c3818d4e4ccc70ef7e01a822f7c6e3222b9ef7d
parent01f5675ec0f6ba70fee076035201afc6ef3acc75 (diff)
downloadtrackermap-server-78770c3ddc9f0073e1993e6a635e2f469d940216.tar.gz
trackermap-server-78770c3ddc9f0073e1993e6a635e2f469d940216.tar.bz2
trackermap-server-78770c3ddc9f0073e1993e6a635e2f469d940216.zip
Fix log formatting
-rw-r--r--src/main/java/org/traccar/Main.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/main/java/org/traccar/Main.java b/src/main/java/org/traccar/Main.java
index 943b5bd7d..a22194d9e 100644
--- a/src/main/java/org/traccar/Main.java
+++ b/src/main/java/org/traccar/Main.java
@@ -52,23 +52,22 @@ public final class Main {
public static void logSystemInfo() {
try {
OperatingSystemMXBean operatingSystemBean = ManagementFactory.getOperatingSystemMXBean();
- LOGGER.info("Operating system"
- + " name: " + operatingSystemBean.getName()
- + " version: " + operatingSystemBean.getVersion()
- + " architecture: " + operatingSystemBean.getArch());
+ LOGGER.info(
+ "Operating system name: {} version: {} architecture: {}",
+ operatingSystemBean.getName(), operatingSystemBean.getVersion(), operatingSystemBean.getArch());
RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
- LOGGER.info("Java runtime"
- + " name: " + runtimeBean.getVmName()
- + " vendor: " + runtimeBean.getVmVendor()
- + " version: " + runtimeBean.getVmVersion());
+ LOGGER.info(
+ "Java runtime name: {} vendor: {} version: {}",
+ runtimeBean.getVmName(), runtimeBean.getVmVendor(), runtimeBean.getVmVersion());
MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
- LOGGER.info("Memory limit"
- + " heap: " + memoryBean.getHeapMemoryUsage().getMax() / (1024 * 1024) + "mb"
- + " non-heap: " + memoryBean.getNonHeapMemoryUsage().getMax() / (1024 * 1024) + "mb");
+ LOGGER.info(
+ "Memory limit heap: {}mb non-heap: {}mb",
+ memoryBean.getHeapMemoryUsage().getMax() / (1024 * 1024),
+ memoryBean.getNonHeapMemoryUsage().getMax() / (1024 * 1024));
- LOGGER.info("Character encoding: " + Charset.defaultCharset().displayName());
+ LOGGER.info("Character encoding: {}", Charset.defaultCharset().displayName());
} catch (Exception error) {
LOGGER.warn("Failed to get system info");
@@ -116,7 +115,7 @@ public final class Main {
try {
injector = Guice.createInjector(new MainModule(configFile), new DatabaseModule(), new WebModule());
logSystemInfo();
- LOGGER.info("Version: " + Main.class.getPackage().getImplementationVersion());
+ LOGGER.info("Version: {}", Main.class.getPackage().getImplementationVersion());
LOGGER.info("Starting server...");
var services = new ArrayList<LifecycleObject>();