Merge pull request #18604 from wycm

* pr/18604:
  Optimize debug level logs

Closes gh-18604
pull/18848/head
Stephane Nicoll 5 years ago
commit 429eec0bcf

@ -174,7 +174,9 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner, Ordered,
if (StringUtils.hasText(this.jobNames)) { if (StringUtils.hasText(this.jobNames)) {
String[] jobsToRun = this.jobNames.split(","); String[] jobsToRun = this.jobNames.split(",");
if (!PatternMatchUtils.simpleMatch(jobsToRun, job.getName())) { if (!PatternMatchUtils.simpleMatch(jobsToRun, job.getName())) {
if (logger.isDebugEnabled()) {
logger.debug("Skipped job: " + job.getName()); logger.debug("Skipped job: " + job.getName());
}
continue; continue;
} }
} }
@ -194,11 +196,13 @@ public class JobLauncherCommandLineRunner implements CommandLineRunner, Ordered,
execute(job, jobParameters); execute(job, jobParameters);
} }
catch (NoSuchJobException ex) { catch (NoSuchJobException ex) {
if (logger.isDebugEnabled()) {
logger.debug("No job found in registry for job name: " + jobName); logger.debug("No job found in registry for job name: " + jobName);
} }
} }
} }
} }
}
protected void execute(Job job, JobParameters jobParameters) protected void execute(Job job, JobParameters jobParameters)
throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException,

@ -63,7 +63,7 @@ class ArtemisEmbeddedConfigurationFactory {
TransportConfiguration transportConfiguration = new TransportConfiguration(InVMAcceptorFactory.class.getName(), TransportConfiguration transportConfiguration = new TransportConfiguration(InVMAcceptorFactory.class.getName(),
this.properties.generateTransportParameters()); this.properties.generateTransportParameters());
configuration.getAcceptorConfigurations().add(transportConfiguration); configuration.getAcceptorConfigurations().add(transportConfiguration);
if (this.properties.isDefaultClusterPassword()) { if (this.properties.isDefaultClusterPassword() && logger.isDebugEnabled()) {
logger.debug("Using default Artemis cluster password: " + this.properties.getClusterPassword()); logger.debug("Using default Artemis cluster password: " + this.properties.getClusterPassword());
} }
configuration.setClusterPassword(this.properties.getClusterPassword()); configuration.setClusterPassword(this.properties.getClusterPassword());

@ -68,8 +68,10 @@ class Connection {
this.inputStream = new ConnectionInputStream(inputStream); this.inputStream = new ConnectionInputStream(inputStream);
this.outputStream = new ConnectionOutputStream(outputStream); this.outputStream = new ConnectionOutputStream(outputStream);
this.header = this.inputStream.readHeader(); this.header = this.inputStream.readHeader();
if (logger.isDebugEnabled()) {
logger.debug("Established livereload connection [" + this.header + "]"); logger.debug("Established livereload connection [" + this.header + "]");
} }
}
/** /**
* Run the connection. * Run the connection.
@ -107,8 +109,10 @@ class Connection {
throw new ConnectionClosedException(); throw new ConnectionClosedException();
} }
else if (frame.getType() == Frame.Type.TEXT) { else if (frame.getType() == Frame.Type.TEXT) {
if (logger.isDebugEnabled()) {
logger.debug("Received LiveReload text frame " + frame); logger.debug("Received LiveReload text frame " + frame);
} }
}
else { else {
throw new IOException("Unexpected Frame Type " + frame.getType()); throw new IOException("Unexpected Frame Type " + frame.getType());
} }

@ -109,7 +109,9 @@ public class LiveReloadServer {
public int start() throws IOException { public int start() throws IOException {
synchronized (this.monitor) { synchronized (this.monitor) {
Assert.state(!isStarted(), "Server already started"); Assert.state(!isStarted(), "Server already started");
if (logger.isDebugEnabled()) {
logger.debug("Starting live reload server on port " + this.port); logger.debug("Starting live reload server on port " + this.port);
}
this.serverSocket = new ServerSocket(this.port); this.serverSocket = new ServerSocket(this.port);
int localPort = this.serverSocket.getLocalPort(); int localPort = this.serverSocket.getLocalPort();
this.listenThread = this.threadFactory.newThread(this::acceptConnections); this.listenThread = this.threadFactory.newThread(this::acceptConnections);

@ -113,9 +113,11 @@ final class FailureAnalyzers implements SpringBootExceptionReporter {
} }
} }
catch (Throwable ex) { catch (Throwable ex) {
if (logger.isDebugEnabled()) {
logger.debug("FailureAnalyzer " + analyzer + " failed", ex); logger.debug("FailureAnalyzer " + analyzer + " failed", ex);
} }
} }
}
return null; return null;
} }

Loading…
Cancel
Save