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.git
The following commit(s) were added to refs/heads/master by this push:
new 044a53b (chore) Cleaned up log messages (#4446)
044a53b is described below
commit 044a53bbcc869039028108c61af42551f7e405a1
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Thu Oct 15 06:59:48 2020 +0200
(chore) Cleaned up log messages (#4446)
- replaced concatenations with log markers
- removed unnecessary debugging guards
Components: camel-influxdb, camel-jaxb, camel-jcr, camel-jetty-common,
camel-jgroups
camel-jms, camel-jmx, camel-jpa, camel-leveldb camel-mail, camel-mock,
camel-salesforce, camel-rabbitmq, camel-quartz, camel-itest-cdi, camel-sjms,
camel-base
---
.../influxdb/converters/CamelInfluxDbConverters.java | 2 +-
.../camel/converter/jaxb/FallbackTypeConverter.java | 4 ++--
.../org/apache/camel/converter/jaxb/JaxbDataFormat.java | 13 ++++++-------
.../apache/camel/converter/jaxb/NonXmlCharFilterer.java | 3 +--
.../org/apache/camel/component/jcr/JcrConsumer.java | 8 +++-----
.../camel/component/jetty/JettyHttpComponent.java | 12 ++++++------
.../jgroups/cluster/JGroupsLockClusterView.java | 9 +++++----
.../java/org/apache/camel/component/jms/JmsBinding.java | 5 +++--
.../org/apache/camel/component/jms/JmsComponent.java | 4 ++--
.../org/apache/camel/component/jms/JmsConsumer.java | 10 ++++------
.../component/jms/reply/TemporaryQueueReplyManager.java | 5 ++---
.../camel/component/jmx/NotificationXmlFormatter.java | 2 +-
.../org/apache/camel/component/jpa/JpaComponent.java | 12 ++++++------
.../org/apache/camel/component/jpa/JpaConsumer.java | 9 ++++-----
.../component/leveldb/LevelDBAggregationRepository.java | 16 ++++++++--------
.../org/apache/camel/component/mail/MailConsumer.java | 17 ++++++++---------
.../org/apache/camel/component/mock/MockEndpoint.java | 12 ++++++------
.../apache/camel/component/quartz/QuartzComponent.java | 4 ++--
.../camel/component/rabbitmq/RabbitMQConsumer.java | 2 +-
.../salesforce/internal/SalesforceSession.java | 2 +-
.../internal/client/SalesforceSecurityHandler.java | 2 +-
.../org/apache/camel/component/sjms/SjmsProducer.java | 10 ++++------
.../camel/component/sjms/batch/SjmsBatchConsumer.java | 7 +++----
.../component/sjms/consumer/InOutMessageHandler.java | 5 ++---
.../org/apache/camel/component/sjms/jms/JmsBinding.java | 5 +++--
.../sjms/tx/SessionBatchTransactionSynchronization.java | 9 ++++-----
.../main/java/org/apache/camel/processor/Enricher.java | 4 +---
.../java/org/apache/camel/processor/PollEnricher.java | 4 +---
.../apache/camel/processor/RecipientListProcessor.java | 8 ++------
.../apache/camel/processor/channel/DefaultChannel.java | 5 +++--
.../main/java/org/apache/camel/itest/cdi/MyRoutes.java | 2 +-
31 files changed, 97 insertions(+), 115 deletions(-)
diff --git
a/components/camel-influxdb/src/main/java/org/apache/camel/component/influxdb/converters/CamelInfluxDbConverters.java
b/components/camel-influxdb/src/main/java/org/apache/camel/component/influxdb/converters/CamelInfluxDbConverters.java
index 541ca78..e3d2aaf 100644
---
a/components/camel-influxdb/src/main/java/org/apache/camel/component/influxdb/converters/CamelInfluxDbConverters.java
+++
b/components/camel-influxdb/src/main/java/org/apache/camel/component/influxdb/converters/CamelInfluxDbConverters.java
@@ -33,7 +33,7 @@ public final class CamelInfluxDbConverters {
public static Point fromMapToPoint(Map<String, Object> map) {
Object measurementName = map.get(InfluxDbConstants.MEASUREMENT_NAME);
if (measurementName == null) {
- String format = String.format("Unable to find the header for the
measurement in:" + map.keySet().toString());
+ String format = String.format("Unable to find the header for the
measurement in: %s", map.keySet().toString());
throw new CamelInfluxDbException(format);
}
diff --git
a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
index fc279dd..272a53a 100644
---
a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
+++
b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
@@ -251,8 +251,8 @@ public class FallbackTypeConverter {
toMarshall = objectFactoryMethod.invoke(instance,
value);
}
} catch (Exception e) {
- LOG.debug("Unable to create JAXBElement object for type "
+ value.getClass() + " due to " + e.getMessage(),
- e);
+ LOG.debug("Unable to create JAXBElement object for type {}
due to {}", value.getClass(),
+ e.getMessage(), e);
}
}
if (needFiltering(exchange)) {
diff --git
a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
index f843fa4..c89a023 100644
---
a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
+++
b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
@@ -252,9 +252,8 @@ public class JaxbDataFormat extends ServiceSupport
throw e;
}
- LOG.debug(
- "Unable to create JAXBElement object for type " +
element.getClass() + " due to " + e.getMessage(),
- e);
+ LOG.debug("Unable to create JAXBElement object for type {}
due to {}", element.getClass(),
+ e.getMessage(), e);
}
}
}
@@ -546,13 +545,13 @@ public class JaxbDataFormat extends ServiceSupport
ClassLoader cl = camelContext.getApplicationContextClassLoader();
if (cl != null) {
if (contextPathIsClassName) {
- LOG.debug("Creating JAXBContext with className: " +
contextPath + " and ApplicationContextClassLoader: "
- + cl);
+ LOG.debug("Creating JAXBContext with className: {} and
ApplicationContextClassLoader: {}",
+ contextPath, cl);
Class clazz =
camelContext.getClassResolver().resolveMandatoryClass(contextPath, cl);
return JAXBContext.newInstance(clazz);
} else {
- LOG.debug("Creating JAXBContext with contextPath: " +
contextPath + " and ApplicationContextClassLoader: "
- + cl);
+ LOG.debug("Creating JAXBContext with contextPath: {} and
ApplicationContextClassLoader: {}",
+ contextPath, cl);
return JAXBContext.newInstance(contextPath, cl);
}
} else {
diff --git
a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/NonXmlCharFilterer.java
b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/NonXmlCharFilterer.java
index a8f4d7c..c4153a5 100644
---
a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/NonXmlCharFilterer.java
+++
b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/NonXmlCharFilterer.java
@@ -85,8 +85,7 @@ class NonXmlCharFilterer {
}
String filtered = new String(chars);
- LOG.warn("Illegal characters were filtered; original => \"" + original
- + "\", filtered => \"" + filtered + "\"");
+ LOG.warn("Illegal characters were filtered; original => \"{}\",
filtered => \"{}\"", original, filtered);
return filtered;
}
diff --git
a/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConsumer.java
b/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConsumer.java
index b6b3443..ae7fd5d 100644
---
a/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConsumer.java
+++
b/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrConsumer.java
@@ -111,11 +111,9 @@ public class JcrConsumer extends DefaultConsumer {
eventListener = new EndpointEventListener(getJcrEndpoint(),
getProcessor());
if (LOG.isDebugEnabled()) {
- LOG.debug("Adding JCR Event Listener, {}, on {}. eventTypes=" +
eventTypes + ", isDeep=" + isDeep
- + ", uuid=" + Arrays.toString(uuid) + ", nodeTypeName="
+ Arrays.toString(nodeTypeName) + ", noLocal="
- + noLocal,
- eventListener,
- absPath);
+ LOG.debug("Adding JCR Event Listener, {}, on {}. eventTypes={},
isDeep={}, uuid={}, nodeTypeName={}, noLocal={}",
+ eventListener, absPath, eventTypes, isDeep,
Arrays.toString(uuid), Arrays.toString(nodeTypeName),
+ noLocal);
}
session.getWorkspace().getObservationManager()
diff --git
a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
index 86c91a3..30acf4e 100644
---
a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
+++
b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
@@ -325,8 +325,9 @@ public abstract class JettyHttpComponent extends
HttpCommonComponent
Server server = createServer();
Connector connector = getConnector(server, endpoint);
if
("localhost".equalsIgnoreCase(endpoint.getHttpUri().getHost())) {
- LOG.warn("You use localhost interface! It means that no
external connections will be available."
- + " Don't you want to use 0.0.0.0 instead (all
network interfaces)? " + endpoint);
+ LOG.warn("You use localhost interface! It means that no
external connections will be available. "
+ + "Don't you want to use 0.0.0.0 instead (all
network interfaces)? {}",
+ endpoint);
}
if (endpoint.isEnableJmx()) {
enableJmx(server);
@@ -459,7 +460,7 @@ public abstract class JettyHttpComponent extends
HttpCommonComponent
pathSpec = pathSpec.endsWith("/") ? pathSpec + "*" : pathSpec +
"/*";
}
addFilter(context, filterHolder, pathSpec);
- LOG.debug("using multipart filter implementation " +
filter.getClass().getName() + " for path " + pathSpec);
+ LOG.debug("using multipart filter implementation {} for path {}",
filter.getClass().getName(), pathSpec);
}
/**
@@ -1185,9 +1186,8 @@ public abstract class JettyHttpComponent extends
HttpCommonComponent
.setMultiPartFormDataCompliance(MultiPartFormDataCompliance.RFC7578);
} catch (Throwable e) {
// ignore this due to OSGi problems
- LOG.debug("Cannot set MultiPartFormDataCompliance to RFC7578 due
to " + e.getMessage()
- + ". This exception is ignored.",
- e);
+ LOG.debug("Cannot set MultiPartFormDataCompliance to RFC7578 due
to {}. This exception is ignored.",
+ e.getMessage(), e);
}
return camelServlet;
diff --git
a/components/camel-jgroups/src/main/java/org/apache/camel/component/jgroups/cluster/JGroupsLockClusterView.java
b/components/camel-jgroups/src/main/java/org/apache/camel/component/jgroups/cluster/JGroupsLockClusterView.java
index 604d816..f584c31 100644
---
a/components/camel-jgroups/src/main/java/org/apache/camel/component/jgroups/cluster/JGroupsLockClusterView.java
+++
b/components/camel-jgroups/src/main/java/org/apache/camel/component/jgroups/cluster/JGroupsLockClusterView.java
@@ -96,13 +96,14 @@ public class JGroupsLockClusterView extends
AbstractCamelClusterView {
executor.execute(new Runnable() {
@Override
public void run() {
- LOG.info("Attempting to become master acquiring the lock for
group: " + lockName + " in JGroups cluster"
- + jgroupsClusterName + " with configuration: " +
jgroupsConfig);
+ LOG.info(
+ "Attempting to become master acquiring the lock for
group: {} in JGroups cluster {} with configuration: {}",
+ lockName, jgroupsClusterName, jgroupsConfig);
lock.lock();
isMaster = true;
fireLeadershipChangedEvent(Optional.ofNullable(localMember));
- LOG.info("Became master by acquiring the lock for group: " +
lockName + " in JGroups cluster"
- + jgroupsClusterName + " with configuration: " +
jgroupsConfig);
+ LOG.info("Became master by acquiring the lock for group: {} in
JGroups cluster {} with configuration: {}",
+ lockName, jgroupsClusterName, jgroupsConfig);
}
});
}
diff --git
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
index 1b9040f..2a95354 100644
---
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
+++
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
@@ -578,9 +578,10 @@ public class JmsBinding {
if (body != null && LOG.isWarnEnabled()) {
LOG.warn("Cannot determine specific JmsMessage type to use from
body class."
+ " Will use generic JmsMessage."
- + " Body class: " +
org.apache.camel.util.ObjectHelper.classCanonicalName(body)
+ + " Body class: {}"
+ ". If you want to send a POJO then your class might
need to implement java.io.Serializable"
- + ", or you can force a specific type by setting the
jmsMessageType option on the JMS endpoint.");
+ + ", or you can force a specific type by setting the
jmsMessageType option on the JMS endpoint.",
+
org.apache.camel.util.ObjectHelper.classCanonicalName(body));
}
// return a default message
diff --git
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
index 2c8f9f0..883518b 100644
---
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
+++
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
@@ -1034,7 +1034,7 @@ public class JmsComponent extends
HeaderFilterStrategyComponent {
ConnectionFactory cf = beans.iterator().next();
configuration.setConnectionFactory(cf);
} else if (beans.size() > 1) {
- LOG.debug("Cannot autowire ConnectionFactory as " +
beans.size() + " instances found in registry.");
+ LOG.debug("Cannot autowire ConnectionFactory as {} instances
found in registry.", beans.size());
}
}
@@ -1044,7 +1044,7 @@ public class JmsComponent extends
HeaderFilterStrategyComponent {
DestinationResolver destinationResolver =
beans.iterator().next();
configuration.setDestinationResolver(destinationResolver);
} else if (beans.size() > 1) {
- LOG.debug("Cannot autowire ConnectionFactory as " +
beans.size() + " instances found in registry.");
+ LOG.debug("Cannot autowire ConnectionFactory as {} instances
found in registry.", beans.size());
}
}
diff --git
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
index a3ff191..4035450 100644
---
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
+++
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
@@ -151,9 +151,8 @@ public class JmsConsumer extends DefaultConsumer implements
Suspendable {
try {
prepareAndStartListenerContainer();
} catch (Throwable e) {
- LOG.warn("Error starting listener container on
destination: " + getDestinationName()
- + ". This exception will be ignored.",
- e);
+ LOG.warn("Error starting listener container on
destination: {}. This exception will be ignored.",
+ getDestinationName(), e);
}
}
@@ -216,9 +215,8 @@ public class JmsConsumer extends DefaultConsumer implements
Suspendable {
try {
stopAndDestroyListenerContainer();
} catch (Throwable e) {
- LOG.warn("Error stopping listener container on
destination: " + getDestinationName()
- + ". This exception will be ignored.",
- e);
+ LOG.warn("Error stopping listener container on
destination: {}. This exception will be ignored.",
+ getDestinationName(), e);
}
}
diff --git
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
index 4bb849a..2349a09 100644
---
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
+++
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/TemporaryQueueReplyManager.java
@@ -186,9 +186,8 @@ public class TemporaryQueueReplyManager extends
ReplyManagerSupport {
@Override
public void onException(JMSException exception) {
// capture exceptions, and schedule a refresh of the ReplyTo
destination
- log.warn("Exception inside the DMLC for Temporary ReplyTo Queue
for destination " + endpoint.getDestinationName()
- + ", refreshing ReplyTo destination",
- exception);
+ log.warn("Exception inside the DMLC for Temporary ReplyTo Queue
for destination {}, refreshing ReplyTo destination",
+ endpoint.getDestinationName(), exception);
destResolver.scheduleRefresh();
// serve as a proxy for any exception listener the user may have
set explicitly
if (delegate != null) {
diff --git
a/components/camel-jmx/src/main/java/org/apache/camel/component/jmx/NotificationXmlFormatter.java
b/components/camel-jmx/src/main/java/org/apache/camel/component/jmx/NotificationXmlFormatter.java
index 969de74..cbb8129 100644
---
a/components/camel-jmx/src/main/java/org/apache/camel/component/jmx/NotificationXmlFormatter.java
+++
b/components/camel-jmx/src/main/java/org/apache/camel/component/jmx/NotificationXmlFormatter.java
@@ -170,7 +170,7 @@ public class NotificationXmlFormatter extends
ServiceSupport {
protected JAXBContext createContext(String contextPath) throws
JAXBException {
ClassLoader cl = NotificationXmlFormatter.class.getClassLoader();
try {
- LOG.info("Creating JAXBContext with contextPath: " + contextPath +
" and classloader: " + cl);
+ LOG.info("Creating JAXBContext with contextPath: {} and
classloader: {}", contextPath, cl);
return JAXBContext.newInstance(contextPath, cl);
} catch (Exception e) {
LOG.info("Creating JAXBContext with contextPath: {}", contextPath);
diff --git
a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
index af61317..850ed18 100644
---
a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
+++
b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
@@ -150,8 +150,8 @@ public class JpaComponent extends DefaultComponent {
if (map != null) {
if (map.size() == 1) {
entityManagerFactory = map.values().iterator().next();
- LOG.info("Using EntityManagerFactory found in registry
with id ["
- + map.keySet().iterator().next() + "] " +
entityManagerFactory);
+ LOG.info("Using EntityManagerFactory found in registry
with id [{}] {}",
+ map.keySet().iterator().next(),
entityManagerFactory);
} else {
LOG.debug("Could not find a single EntityManagerFactory in
registry as there was {} instances.",
map.size());
@@ -168,8 +168,8 @@ public class JpaComponent extends DefaultComponent {
if (map != null) {
if (map.size() == 1) {
transactionManager = map.values().iterator().next();
- LOG.info("Using TransactionManager found in registry with
id ["
- + map.keySet().iterator().next() + "] " +
transactionManager);
+ LOG.info("Using TransactionManager found in registry with
id [{}] {}",
+ map.keySet().iterator().next(),
transactionManager);
} else {
LOG.debug("Could not find a single TransactionManager in
registry as there was {} instances.", map.size());
}
@@ -185,8 +185,8 @@ public class JpaComponent extends DefaultComponent {
if (map != null) {
if (map.size() == 1) {
transactionManager =
map.values().iterator().next().getTransactionManager();
- LOG.info("Using TransactionManager found in registry with
id ["
- + map.keySet().iterator().next() + "] " +
transactionManager);
+ LOG.info("Using TransactionManager found in registry with
id [{}] {}",
+ map.keySet().iterator().next(),
transactionManager);
} else {
LOG.debug("Could not find a single TransactionTemplate in
registry as there was {} instances.", map.size());
}
diff --git
a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
index 653ff3e..6bb0774 100644
---
a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
+++
b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
@@ -175,8 +175,8 @@ public class JpaConsumer extends
ScheduledBatchPollingConsumer {
// limit if needed
if (maxMessagesPerPoll > 0 && total > maxMessagesPerPoll) {
- LOG.debug("Limiting to maximum messages to poll " +
maxMessagesPerPoll + " as there were " + total
- + " messages in this poll.");
+ LOG.debug("Limiting to maximum messages to poll {} as there were
{} messages in this poll.",
+ maxMessagesPerPoll, total);
total = maxMessagesPerPoll;
}
@@ -356,9 +356,8 @@ public class JpaConsumer extends
ScheduledBatchPollingConsumer {
}
return true;
} catch (Exception e) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Failed to achieve lock on entity: " + entity + ".
Reason: " + e, e);
- }
+ LOG.debug("Failed to achieve lock on entity: {}. Reason: {}",
entity, e.getMessage(), e);
+
if (e instanceof PessimisticLockException || e instanceof
OptimisticLockException) {
//transaction marked as rollback can't continue gracefully
throw (PersistenceException) e;
diff --git
a/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBAggregationRepository.java
b/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBAggregationRepository.java
index 78d1eca..8ef6797 100644
---
a/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBAggregationRepository.java
+++
b/components/camel-leveldb/src/main/java/org/apache/camel/component/leveldb/LevelDBAggregationRepository.java
@@ -433,18 +433,18 @@ public class LevelDBAggregationRepository extends
ServiceSupport implements Reco
int completed = size(getRepositoryNameCompleted());
if (current > 0) {
- LOG.info("On startup there are " + current + " aggregate exchanges
(not completed) in repository: "
- + getRepositoryName());
+ LOG.info("On startup there are {} aggregate exchanges (not
completed) in repository: {}",
+ current, getRepositoryName());
} else {
- LOG.info("On startup there are no existing aggregate exchanges
(not completed) in repository: "
- + getRepositoryName());
+ LOG.info("On startup there are no existing aggregate exchanges
(not completed) in repository: {}",
+ getRepositoryName());
}
if (completed > 0) {
- LOG.warn("On startup there are " + completed + " completed
exchanges to be recovered in repository: "
- + getRepositoryNameCompleted());
+ LOG.warn("On startup there are {} completed exchanges to be
recovered in repository: {}",
+ completed, getRepositoryNameCompleted());
} else {
- LOG.info("On startup there are no completed exchanges to be
recovered in repository: "
- + getRepositoryNameCompleted());
+ LOG.info("On startup there are no completed exchanges to be
recovered in repository: {}",
+ getRepositoryNameCompleted());
}
}
diff --git
a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
index c965de5..dd541b2 100644
---
a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
+++
b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
@@ -184,7 +184,7 @@ public class MailConsumer extends
ScheduledBatchPollingConsumer {
}
} catch (Exception e) {
// some mail servers will lock the folder so we ignore in
this case (CAMEL-1263)
- LOG.debug("Could not close mailbox folder: " +
folder.getName() + ". This exception is ignored.", e);
+ LOG.debug("Could not close mailbox folder: {}. This
exception is ignored.", folder.getName(), e);
}
}
}
@@ -265,7 +265,7 @@ public class MailConsumer extends
ScheduledBatchPollingConsumer {
beanIntrospection.setProperty(getEndpoint().getCamelContext(),
mail, "peek", true);
} catch (Throwable e) {
// ignore
- LOG.trace("Error setting peak property to true on: " + mail +
". This exception is ignored.", e);
+ LOG.trace("Error setting peak property to true on: {}. This
exception is ignored.", mail, e);
}
}
}
@@ -332,7 +332,7 @@ public class MailConsumer extends
ScheduledBatchPollingConsumer {
msgs.add(msg);
} catch (Exception e) {
if (skipFailedMessage) {
- LOG.debug("Skipping failed message at index " + i + " due
" + e.getMessage(), e);
+ LOG.debug("Skipping failed message at index {} due {}", i,
e.getMessage(), e);
} else if (handleFailedMessage) {
handleException(e);
} else {
@@ -416,7 +416,7 @@ public class MailConsumer extends
ScheduledBatchPollingConsumer {
}
} catch (Exception e) {
if (skipFailedMessage) {
- LOG.debug("Skipping failed message at index " + i + " due
" + e.getMessage(), e);
+ LOG.debug("Skipping failed message at index {} due {}", i,
e.getMessage(), e);
} else if (handleFailedMessage) {
handleException(e);
} else {
@@ -471,7 +471,8 @@ public class MailConsumer extends
ScheduledBatchPollingConsumer {
if (found == null) {
boolean delete =
getEndpoint().getConfiguration().isDelete();
- LOG.warn("POP3message not found in folder. Message cannot
be marked as " + (delete ? "DELETED" : "SEEN"));
+ LOG.warn("POP3message not found in folder. Message cannot
be marked as {}",
+ delete ? "DELETED" : "SEEN");
} else {
mail = found;
}
@@ -561,10 +562,8 @@ public class MailConsumer extends
ScheduledBatchPollingConsumer {
connected = true;
}
} catch (Exception e) {
- LOG.debug("Exception while testing for is connected to MailStore: "
- +
getEndpoint().getConfiguration().getMailStoreLogInformation()
- + ". Caused by: " + e.getMessage(),
- e);
+ LOG.debug("Exception while testing for is connected to MailStore:
{}. Caused by: {}",
+
getEndpoint().getConfiguration().getMailStoreLogInformation(), e.getMessage(),
e);
}
if (!connected) {
diff --git
a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 934c102..c793d7e 100644
---
a/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++
b/components/camel-mock/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -449,7 +449,7 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint,
for (Throwable failure : failures) {
if (failure != null) {
- LOG.error("Caught exception on " + getEndpointUri() + " due
to: " + failure.getMessage(), failure);
+ LOG.error("Caught exception on {} due to: {}",
getEndpointUri(), failure.getMessage(), failure);
fail(failure);
}
}
@@ -467,9 +467,9 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint,
} catch (AssertionError e) {
if (LOG.isDebugEnabled()) {
// log incl stacktrace
- LOG.debug("Caught expected failure: " + e.getMessage(), e);
+ LOG.debug("Caught expected failure: {}", e.getMessage(), e);
} else {
- LOG.info("Caught expected failure: " + e.getMessage());
+ LOG.info("Caught expected failure: {}", e.getMessage());
}
}
if (failed) {
@@ -492,9 +492,9 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint,
} catch (AssertionError e) {
if (LOG.isDebugEnabled()) {
// log incl stacktrace
- LOG.debug("Caught expected failure: " + e.getMessage(), e);
+ LOG.debug("Caught expected failure: {}", e.getMessage(), e);
} else {
- LOG.info("Caught expected failure: " + e.getMessage());
+ LOG.info("Caught expected failure: {}", e.getMessage());
}
}
if (failed) {
@@ -1567,7 +1567,7 @@ public class MockEndpoint extends DefaultEndpoint
implements BrowsableEndpoint,
} catch (AssertionError e) {
failFastAssertionError = e;
// signal latch we are done as we are failing fast
- LOG.debug("Assertion failed fast on " + index + "
received exchange due to " + e.getMessage());
+ LOG.debug("Assertion failed fast on {} received
exchange due to ", index, e.getMessage());
while (latch != null && latch.getCount() > 0) {
latch.countDown();
}
diff --git
a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index 7fe9951..00295d9 100644
---
a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++
b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -507,8 +507,8 @@ public class QuartzComponent extends DefaultComponent
implements ExtendedStartup
} else {
AtomicInteger number = (AtomicInteger)
scheduler.getContext().get(QuartzConstants.QUARTZ_CAMEL_JOBS_COUNT);
if (number != null && number.get() > 0) {
- LOG.info("Cannot shutdown scheduler: " +
scheduler.getSchedulerName() + " as there are still "
- + number.get() + " jobs registered.");
+ LOG.info("Cannot shutdown scheduler: {} as there are still
{} jobs registered.",
+ scheduler.getSchedulerName(), number.get());
} else {
LOG.info("Shutting down scheduler. (will wait for all jobs
to complete first.)");
scheduler.shutdown(true);
diff --git
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java
index 6441deb..63b044d 100644
---
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java
+++
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java
@@ -220,7 +220,7 @@ public class RabbitMQConsumer extends DefaultConsumer
implements Suspendable {
}
connectionFailed = false;
} catch (Exception e) {
- LOG.info("Connection failed, will retry in " +
connectionRetryInterval + "ms", e);
+ LOG.info("Connection failed, will retry in {} ms",
connectionRetryInterval, e);
Thread.sleep(connectionRetryInterval);
}
}
diff --git
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
index 43e93e3..a80cca5 100644
---
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
+++
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
@@ -117,7 +117,7 @@ public class SalesforceSession extends ServiceSupport {
try {
logout();
} catch (SalesforceException e) {
- LOG.warn("Error revoking old access token: " +
e.getMessage(), e);
+ LOG.warn("Error revoking old access token: {}",
e.getMessage(), e);
}
accessToken = null;
}
diff --git
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java
index eb97a8d..62633be 100644
---
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java
+++
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java
@@ -191,7 +191,7 @@ public class SalesforceSecurityHandler implements
ProtocolHandler {
protected void retryOnFailure(
SalesforceHttpRequest request, HttpConversation conversation,
Integer retries, AbstractClientBase client,
Throwable failure) {
- LOG.warn("Retrying on Salesforce authentication failure " +
failure.getMessage(), failure);
+ LOG.warn("Retrying on Salesforce authentication failure {}",
failure.getMessage(), failure);
// retry request
retryRequest(request, client, retries, conversation, true);
diff --git
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsProducer.java
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsProducer.java
index f7506d6..2044df6 100644
---
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsProducer.java
+++
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/SjmsProducer.java
@@ -116,9 +116,8 @@ public abstract class SjmsProducer extends
DefaultAsyncProducer {
try {
fillProducersPool();
} catch (Throwable e) {
- LOG.warn("Error filling producer pool for
destination: " + getDestinationName()
- + ". This exception will be ignored.",
- e);
+ LOG.warn("Error filling producer pool for
destination: {}. This exception will be ignored.",
+ getDestinationName(), e);
}
}
@@ -155,9 +154,8 @@ public abstract class SjmsProducer extends
DefaultAsyncProducer {
getProducers().close();
setProducers(null);
} catch (Throwable e) {
- LOG.warn("Error closing producers on destination:
" + getDestinationName()
- + ". This exception will be ignored.",
- e);
+ LOG.warn("Error closing producers on destination:
{}. This exception will be ignored.",
+ getDestinationName(), e);
}
}
diff --git
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/batch/SjmsBatchConsumer.java
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/batch/SjmsBatchConsumer.java
index fb6b497..a625877 100644
---
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/batch/SjmsBatchConsumer.java
+++
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/batch/SjmsBatchConsumer.java
@@ -473,9 +473,8 @@ public class SjmsBatchConsumer extends DefaultConsumer {
reset();
}
} catch (Exception e) {
- LOG.warn("Error during evaluation of
completion predicate " + e.getMessage()
- + ". This exception is ignored.",
- e);
+ LOG.warn("Error during evaluation of
completion predicate {}. This exception is ignored.",
+ e.getMessage(), e);
}
}
}
@@ -570,7 +569,7 @@ public class SjmsBatchConsumer extends DefaultConsumer {
int batchSize = exchange.getProperty(Exchange.BATCH_SIZE,
Integer.class);
if (LOG.isDebugEnabled()) {
long total = MESSAGE_RECEIVED.get() + batchSize;
- LOG.debug("Processing batch[" + id + "]:size=" + batchSize +
":total=" + total);
+ LOG.debug("Processing batch[{}]:size={}:total={}", id,
batchSize, total);
}
if ("timeout".equals(completedBy)) {
diff --git
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/consumer/InOutMessageHandler.java
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/consumer/InOutMessageHandler.java
index 5cd2d33..c965874 100644
---
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/consumer/InOutMessageHandler.java
+++
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/consumer/InOutMessageHandler.java
@@ -127,9 +127,8 @@ public class InOutMessageHandler extends
AbstractMessageHandler {
try {
entry.getValue().close();
} catch (JMSException e) {
- log.debug("Cached MessageProducer with key: " + entry.getKey()
- + " threw an unexpected exception. This exception is
ignored.",
- e);
+ log.debug("Cached MessageProducer with key: {} threw an
unexpected exception. This exception is ignored.",
+ entry.getKey(), e);
}
}
producerCache.clear();
diff --git
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java
index 1fee671..23f2d84 100644
---
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java
+++
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/jms/JmsBinding.java
@@ -487,9 +487,10 @@ public class JmsBinding {
if (body != null && LOG.isWarnEnabled()) {
LOG.warn("Cannot determine specific JmsMessage type to use from
body class."
+ " Will use generic JmsMessage."
- + " Body class: " + ObjectHelper.classCanonicalName(body)
+ + " Body class: {}"
+ ". If you want to send a POJO then your class might
need to implement java.io.Serializable"
- + ", or you can force a specific type by setting the
jmsMessageType option on the JMS endpoint.");
+ + ", or you can force a specific type by setting the
jmsMessageType option on the JMS endpoint.",
+ ObjectHelper.classCanonicalName(body));
}
// return a default message
diff --git
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/SessionBatchTransactionSynchronization.java
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/SessionBatchTransactionSynchronization.java
index fedb00f..d36aa42 100644
---
a/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/SessionBatchTransactionSynchronization.java
+++
b/components/camel-sjms/src/main/java/org/apache/camel/component/sjms/tx/SessionBatchTransactionSynchronization.java
@@ -71,7 +71,7 @@ public class SessionBatchTransactionSynchronization
implements Synchronization {
}
}
} catch (Exception e) {
- LOG.warn("Failed to rollback the session: " + e.getMessage() + ".
This exception will be ignored.", e);
+ LOG.warn("Failed to rollback the session: {}. This exception will
be ignored.", e.getMessage(), e);
} finally {
lock.readLock().unlock();
}
@@ -90,7 +90,7 @@ public class SessionBatchTransactionSynchronization
implements Synchronization {
}
}
} catch (Exception e) {
- LOG.warn("Failed to commit the session: " + e.getMessage() + ".
This exception will be ignored.", e);
+ LOG.warn("Failed to commit the session: {}. This exception will be
ignored.", e.getMessage(), e);
exchange.setException(e);
} finally {
lock.readLock().unlock();
@@ -138,9 +138,8 @@ public class SessionBatchTransactionSynchronization
implements Synchronization {
}
((BatchTransactionCommitStrategy) commitStrategy).reset();
} catch (Exception e) {
- LOG.warn("Failed to commit the session during timeout: " +
e.getMessage()
- + ". This exception will be ignored.",
- e);
+ LOG.warn("Failed to commit the session during timeout: {}.
This exception will be ignored.",
+ e.getMessage(), e);
}
} finally {
lock.writeLock().unlock();
diff --git
a/core/camel-base/src/main/java/org/apache/camel/processor/Enricher.java
b/core/camel-base/src/main/java/org/apache/camel/processor/Enricher.java
index 61b7c7d..4578209 100644
--- a/core/camel-base/src/main/java/org/apache/camel/processor/Enricher.java
+++ b/core/camel-base/src/main/java/org/apache/camel/processor/Enricher.java
@@ -190,9 +190,7 @@ public class Enricher extends AsyncProcessorSupport
implements IdAware, RouteIdA
producer = producerCache.acquireProducer(endpoint);
} catch (Throwable e) {
if (isIgnoreInvalidEndpoint()) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Endpoint uri is invalid: " + recipient + ".
This exception will be ignored.", e);
- }
+ LOG.debug("Endpoint uri is invalid: {}. This exception will be
ignored.", recipient, e);
} else {
exchange.setException(e);
}
diff --git
a/core/camel-base/src/main/java/org/apache/camel/processor/PollEnricher.java
b/core/camel-base/src/main/java/org/apache/camel/processor/PollEnricher.java
index ff80c3c..48f7e90 100644
--- a/core/camel-base/src/main/java/org/apache/camel/processor/PollEnricher.java
+++ b/core/camel-base/src/main/java/org/apache/camel/processor/PollEnricher.java
@@ -247,9 +247,7 @@ public class PollEnricher extends AsyncProcessorSupport
implements IdAware, Rout
consumer = consumerCache.acquirePollingConsumer(endpoint);
} catch (Throwable e) {
if (isIgnoreInvalidEndpoint()) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Endpoint uri is invalid: " + recipient + ".
This exception will be ignored.", e);
- }
+ LOG.debug("Endpoint uri is invalid: {}. This exception will be
ignored.", recipient, e);
} else {
exchange.setException(e);
}
diff --git
a/core/camel-base/src/main/java/org/apache/camel/processor/RecipientListProcessor.java
b/core/camel-base/src/main/java/org/apache/camel/processor/RecipientListProcessor.java
index de259ac..66aa62f 100644
---
a/core/camel-base/src/main/java/org/apache/camel/processor/RecipientListProcessor.java
+++
b/core/camel-base/src/main/java/org/apache/camel/processor/RecipientListProcessor.java
@@ -141,9 +141,7 @@ public class RecipientListProcessor extends
MulticastProcessor {
ServiceHelper.stopAndShutdownService(endpoint);
}
} catch (Exception e) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Error releasing producer: " + producer + ".
This exception will be ignored.", e);
- }
+ LOG.debug("Error releasing producer: {}. This exception will
be ignored.", producer, e);
}
}
@@ -221,9 +219,7 @@ public class RecipientListProcessor extends
MulticastProcessor {
producer = producerCache.acquireProducer(endpoint);
} catch (Exception e) {
if (isIgnoreInvalidEndpoints()) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Endpoint uri is invalid: " + recipient + ".
This exception will be ignored.", e);
- }
+ LOG.debug("Endpoint uri is invalid: {}. This exception
will be ignored.", recipient, e);
continue;
} else {
// failure so break out
diff --git
a/core/camel-base/src/main/java/org/apache/camel/processor/channel/DefaultChannel.java
b/core/camel-base/src/main/java/org/apache/camel/processor/channel/DefaultChannel.java
index 8b50a93..5dd2f80 100644
---
a/core/camel-base/src/main/java/org/apache/camel/processor/channel/DefaultChannel.java
+++
b/core/camel-base/src/main/java/org/apache/camel/processor/channel/DefaultChannel.java
@@ -241,11 +241,12 @@ public class DefaultChannel extends
CamelInternalProcessor implements Channel {
// use the fine grained definition (eg the child if available).
Its always possible to get back to the parent
Processor wrapped =
strategy.wrapProcessorInInterceptors(route.getCamelContext(), targetOutputDef,
target, next);
if (!(wrapped instanceof AsyncProcessor)) {
- LOG.warn("Interceptor: " + strategy + " at: " + definition + "
does not return an AsyncProcessor instance."
+ LOG.warn("Interceptor: {} at: {} does not return an
AsyncProcessor instance."
+ " This causes the asynchronous routing engine to
not work as optimal as possible."
+ " See more details at the InterceptStrategy
javadoc."
+ " Camel will use a bridge to adapt the interceptor
to the asynchronous routing engine,"
- + " but its not the most optimal solution. Please
consider changing your interceptor to comply.");
+ + " but its not the most optimal solution. Please
consider changing your interceptor to comply.",
+ strategy, definition);
}
if (!(wrapped instanceof WrapProcessor)) {
// wrap the target so it becomes a service and we can manage
its lifecycle
diff --git
a/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/MyRoutes.java
b/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/MyRoutes.java
index d2bc768..47a34d1 100644
---
a/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/MyRoutes.java
+++
b/tests/camel-itest-cdi/src/main/java/org/apache/camel/itest/cdi/MyRoutes.java
@@ -46,7 +46,7 @@ public class MyRoutes extends RouteBuilder {
@Override
public void configure() {
- LOG.info("Adding route from " + a + " to " + b);
+ LOG.info("Adding route from {} to {}", a, b);
from(a).to(b);
}