diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java index 8612d991e3..087f3fdbaf 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java @@ -174,7 +174,9 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner, Ordered, if (StringUtils.hasText(this.jobNames)) { String[] jobsToRun = this.jobNames.split(","); if (!PatternMatchUtils.simpleMatch(jobsToRun, job.getName())) { - logger.debug("Skipped job: " + job.getName()); + if (logger.isDebugEnabled()) { + logger.debug("Skipped job: " + job.getName()); + } continue; } } @@ -194,7 +196,9 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner, Ordered, execute(job, jobParameters); } catch (NoSuchJobException ex) { - logger.debug("No job found in registry for job name: " + jobName); + if (logger.isDebugEnabled()) { + logger.debug("No job found in registry for job name: " + jobName); + } } } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java index 0438acfa3e..58b26c68a5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java @@ -63,7 +63,7 @@ class ArtemisEmbeddedConfigurationFactory { TransportConfiguration transportConfiguration = new TransportConfiguration(InVMAcceptorFactory.class.getName(), this.properties.generateTransportParameters()); configuration.getAcceptorConfigurations().add(transportConfiguration); - if (this.properties.isDefaultClusterPassword()) { + if (this.properties.isDefaultClusterPassword() && logger.isDebugEnabled()) { logger.debug("Using default Artemis cluster password: " + this.properties.getClusterPassword()); } configuration.setClusterPassword(this.properties.getClusterPassword()); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java index 480f4497ac..526e63bafb 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java @@ -68,7 +68,9 @@ class Connection { this.inputStream = new ConnectionInputStream(inputStream); this.outputStream = new ConnectionOutputStream(outputStream); this.header = this.inputStream.readHeader(); - logger.debug("Established livereload connection [" + this.header + "]"); + if (logger.isDebugEnabled()) { + logger.debug("Established livereload connection [" + this.header + "]"); + } } /** @@ -107,7 +109,9 @@ class Connection { throw new ConnectionClosedException(); } else if (frame.getType() == Frame.Type.TEXT) { - logger.debug("Received LiveReload text frame " + frame); + if (logger.isDebugEnabled()) { + logger.debug("Received LiveReload text frame " + frame); + } } else { throw new IOException("Unexpected Frame Type " + frame.getType()); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java index 643a9f5184..08157b6f46 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java @@ -109,7 +109,9 @@ public class LiveReloadServer { public int start() throws IOException { synchronized (this.monitor) { Assert.state(!isStarted(), "Server already started"); - logger.debug("Starting live reload server on port " + this.port); + if (logger.isDebugEnabled()) { + logger.debug("Starting live reload server on port " + this.port); + } this.serverSocket = new ServerSocket(this.port); int localPort = this.serverSocket.getLocalPort(); this.listenThread = this.threadFactory.newThread(this::acceptConnections); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/FailureAnalyzers.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/FailureAnalyzers.java index 2661e260f6..5f4e4b233e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/FailureAnalyzers.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/FailureAnalyzers.java @@ -113,7 +113,9 @@ final class FailureAnalyzers implements SpringBootExceptionReporter { } } catch (Throwable ex) { - logger.debug("FailureAnalyzer " + analyzer + " failed", ex); + if (logger.isDebugEnabled()) { + logger.debug("FailureAnalyzer " + analyzer + " failed", ex); + } } } return null;