summaryrefslogtreecommitdiffstats
path: root/server/sonar-process
diff options
context:
space:
mode:
authorDaniel Trebbien <dtrebbien@gmail.com>2017-10-09 10:14:34 -0500
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-10-10 13:28:44 +0200
commit0c4ab610218ff4b7532cd6483dee150f78c1fd3e (patch)
tree4a30a5b3c92702544b09ac7e909e566f988710cc /server/sonar-process
parent1719abc62d33568dfc1a1d8d90262062211c5f39 (diff)
downloadsonarqube-0c4ab610218ff4b7532cd6483dee150f78c1fd3e.tar.gz
sonarqube-0c4ab610218ff4b7532cd6483dee150f78c1fd3e.zip
Utilize parameterized logging
As suggested in the SLF4J FAQ: https://www.slf4j.org/faq.html#logging_performance .. parameterized logging can improve the efficiency of logger calls when logging at the specified level is disabled. In addition, per the FAQ: https://www.slf4j.org/faq.html#paramException since SLF4J 1.6.0 it is possible to use parameterized logging and also log an exception/throwable. These changes were suggested by SLF4J Helper for NetBeans IDE: http://plugins.netbeans.org/plugin/72557/
Diffstat (limited to 'server/sonar-process')
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/Jmx.java2
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/Jmx.java b/server/sonar-process/src/main/java/org/sonar/process/Jmx.java
index 5324be1955e..ddad31ea7f1 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/Jmx.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/Jmx.java
@@ -80,7 +80,7 @@ public class Jmx {
try {
ManagementFactory.getPlatformMBeanServer().unregisterMBean(new ObjectName(name));
} catch (Exception e) {
- LoggerFactory.getLogger(Jmx.class).warn("Can not unregister MBean [" + name + "]", e);
+ LoggerFactory.getLogger(Jmx.class).warn("Can not unregister MBean [{}]", name, e);
}
}
}
diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java
index 76b89a007f9..1ee6df0864b 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessEntryPoint.java
@@ -99,14 +99,14 @@ public class ProcessEntryPoint implements Stoppable {
try {
launch(logger);
} catch (Exception e) {
- logger.warn("Fail to start " + getKey(), e);
+ logger.warn("Fail to start {}", getKey(), e);
} finally {
stop();
}
}
private void launch(Logger logger) throws InterruptedException {
- logger.info("Starting " + getKey());
+ logger.info("Starting {}", getKey());
Runtime.getRuntime().addShutdownHook(shutdownHook);
stopWatcher.start();