You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/01/23 08:29:00 UTC
[camel-spring-boot] 01/04: CAMEL-14421: optimize core -
ServiceSupport should not have instance logger. Use static logger instead.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
commit a012b6b078422a04183f38909cd0fbad09ad04de
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Jan 23 08:25:47 2020 +0100
CAMEL-14421: optimize core - ServiceSupport should not have instance logger. Use static logger instead.
---
.../camel/spring/boot/CamelSpringBootApplicationListener.java | 4 ++--
.../java/org/apache/camel/spring/boot/SpringBootCamelContext.java | 7 ++++++-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java b/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
index 107d749..58ace8a 100644
--- a/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
+++ b/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
@@ -173,11 +173,11 @@ public class CamelSpringBootApplicationListener implements ApplicationListener<C
@Override
public void notify(CamelEvent eventObject) throws Exception {
for (CamelContextConfiguration camelContextConfiguration : camelContextConfigurations) {
- log.debug("CamelContextConfiguration found. Invoking afterApplicationStart: {}", camelContextConfiguration);
+ LOG.debug("CamelContextConfiguration found. Invoking afterApplicationStart: {}", camelContextConfiguration);
try {
camelContextConfiguration.afterApplicationStart(camelContext);
} catch (Exception e) {
- log.warn("Error during calling afterApplicationStart due " + e.getMessage() + ". This exception is ignored", e);
+ LOG.warn("Error during calling afterApplicationStart due " + e.getMessage() + ". This exception is ignored", e);
}
}
}
diff --git a/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringBootCamelContext.java b/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringBootCamelContext.java
index 1b32495..2b38ba5 100644
--- a/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringBootCamelContext.java
+++ b/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringBootCamelContext.java
@@ -17,7 +17,10 @@
package org.apache.camel.spring.boot;
import org.apache.camel.spring.SpringCamelContext;
+import org.apache.camel.support.service.ServiceSupport;
import org.apache.camel.util.StopWatch;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
/**
@@ -25,6 +28,8 @@ import org.springframework.context.ApplicationContext;
*/
public class SpringBootCamelContext extends SpringCamelContext {
+ private static final Logger LOG = LoggerFactory.getLogger(SpringBootCamelContext.class);
+
private final StopWatch stopWatch = new StopWatch();
private final boolean warnOnEarlyShutdown;
@@ -49,7 +54,7 @@ public class SpringBootCamelContext extends SpringCamelContext {
boolean junit = cp != null && cp.contains("junit-");
boolean starterWeb = cp != null && cp.contains("spring-boot-starter-web");
if (!junit && !starterWeb) {
- log.warn("CamelContext has only been running for less than a second. If you intend to run Camel for a longer time "
+ LOG.warn("CamelContext has only been running for less than a second. If you intend to run Camel for a longer time "
+ "then you can set the property camel.springboot.main-run-controller=true in application.properties"
+ " or add spring-boot-starter-web JAR to the classpath.");
}