This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 0ce3184 (chores) logging cleanups (#5675)
0ce3184 is described below
commit 0ce3184cedef9e6ef23b84b82da68ae0e1808dcd
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Wed Jun 16 14:51:26 2021 +0200
(chores) logging cleanups (#5675)
- use log markers for the test log messages
- remove unnecessary log guards
- use the correct newline format specifier
- use log markers for the test log messages
- fixed references to invalid class name in log message
---
.../camel/component/aws/xray/XRayTracer.java | 12 ++---
.../operations/EventHubsProducerOperations.java | 2 +-
.../org/apache/camel/component/bean/BeanInfo.java | 6 +--
.../camel/component/box/api/BoxSearchManager.java | 4 +-
.../camel/component/corda/CordaConsumer.java | 2 +-
.../component/file/remote/SftpOperations.java | 4 +-
.../workitem/AbstractCamelWorkItemHandler.java | 2 +-
.../lock/KubernetesLeadershipController.java | 40 +++++++--------
.../mongodb/MongoAbstractConsumerThread.java | 9 ++--
.../apache/camel/openapi/RestModelConverters.java | 2 +-
.../component/SoroushBotAbstractConsumer.java | 10 ++--
.../soroushbot/component/SoroushBotEndpoint.java | 60 +++++++++-------------
.../springrabbit/SpringRabbitMQEndpoint.java | 17 +++---
.../spring/junit5/CamelAnnotationsHandler.java | 2 +-
.../junit5/CamelSpringTestContextLoader.java | 8 +--
.../camel/test/spring/CamelAnnotationsHandler.java | 2 +-
.../test/spring/CamelSpringTestContextLoader.java | 8 +--
.../apache/camel/test/junit4/CamelTestSupport.java | 12 ++---
.../org/apache/camel/test/junit4/TestSupport.java | 2 +-
.../camel/component/web3j/Web3jConsumer.java | 2 +-
.../component/zookeepermaster/MasterConsumer.java | 4 +-
.../group/internal/ZooKeeperGroup.java | 8 +--
.../zookeepermaster/policy/MasterRoutePolicy.java | 4 +-
.../camel/impl/engine/AbstractCamelContext.java | 14 ++---
.../camel/impl/engine/DefaultShutdownStrategy.java | 9 ++--
.../component/properties/PropertiesComponent.java | 9 ++--
.../org/apache/camel/impl/DefaultCamelContext.java | 12 ++---
.../processor/aggregate/AggregateProcessor.java | 6 +--
.../org/apache/camel/main/BaseMainSupport.java | 2 +-
.../management/JmxManagementLifecycleStrategy.java | 6 +--
.../apache/camel/saga/InMemorySagaCoordinator.java | 9 ++--
.../apache/camel/maven/AbstractGeneratorMojo.java | 2 +-
32 files changed, 135 insertions(+), 156 deletions(-)
diff --git
a/components/camel-aws/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
b/components/camel-aws/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
index fe53826..679be3d 100644
---
a/components/camel-aws/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
+++
b/components/camel-aws/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/XRayTracer.java
@@ -297,8 +297,8 @@ public class XRayTracer extends ServiceSupport implements
RoutePolicyFactory, St
}
ese.getExchange().setProperty(CURRENT_SEGMENT,
subsegment);
} catch (AlreadyEmittedException aeEx) {
- LOG.warn("Ignoring starting of subsegment " + name + "
as its parent segment"
- + " was already emitted to AWS.");
+ LOG.warn("Ignoring starting of subsegment {} as its
parent segment was already emitted to AWS.",
+ name);
}
} else {
LOG.trace("Ignoring creation of XRay subsegment as no
segment exists in the current thread");
@@ -326,8 +326,8 @@ public class XRayTracer extends ServiceSupport implements
RoutePolicyFactory, St
}
ese.getExchange().setProperty(CURRENT_SEGMENT,
subsegment.getParent());
} catch (AlreadyEmittedException aeEx) {
- LOG.warn("Ignoring close of subsegment " +
entity.getName()
- + " as its parent segment was already emitted
to AWS");
+ LOG.warn("Ignoring close of subsegment {} as its
parent segment was already emitted to AWS",
+ entity.getName());
}
}
} else {
@@ -415,8 +415,8 @@ public class XRayTracer extends ServiceSupport implements
RoutePolicyFactory, St
}
exchange.setProperty(CURRENT_SEGMENT, subsegment);
} catch (AlreadyEmittedException aeEx) {
- LOG.warn("Ignoring opening of subsegment " + route.getId()
+ " as its parent segment "
- + segmentName + " was already emitted before.");
+ LOG.warn("Ignoring opening of subsegment {} as its parent
segment {} was already emitted before.",
+ route.getId(), segmentName);
}
}
}
diff --git
a/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/operations/EventHubsProducerOperations.java
b/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/operations/EventHubsProducerOperations.java
index 4037ba2..0a4a9f7 100644
---
a/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/operations/EventHubsProducerOperations.java
+++
b/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/operations/EventHubsProducerOperations.java
@@ -66,7 +66,7 @@ public class EventHubsProducerOperations {
sendAsyncEventsWithSuitableMethod(eventData, sendOptions)
.subscribe(unused -> LOG.debug("Processed one event..."),
error -> {
// error but we continue
- LOG.debug("Error processing async exchange with error:" +
error.getMessage());
+ LOG.debug("Error processing async exchange with error:
{}", error.getMessage());
exchange.setException(error);
asyncCallback.done(false);
}, () -> {
diff --git
a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
index 8da7126..07a1efa 100644
---
a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
+++
b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanInfo.java
@@ -1016,9 +1016,9 @@ public class BeanInfo {
AnnotationExpressionFactory expressionFactory =
(AnnotationExpressionFactory) object;
return expressionFactory.createExpression(camelContext,
annotation, languageAnnotation, parameterType);
} else {
- LOG.warn("Ignoring bad annotation: " + languageAnnotation
+ "on method: " + method
- + " which declares a factory: " + type.getName()
- + " which does not implement " +
AnnotationExpressionFactory.class.getName());
+ LOG.warn(
+ "Ignoring bad annotation: {} on method: {} which
declares a factory {} which does not implement {}",
+ languageAnnotation, method, type.getName(),
AnnotationExpressionFactory.class.getName());
}
}
}
diff --git
a/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxSearchManager.java
b/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxSearchManager.java
index e63d9f8..306b797 100644
---
a/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxSearchManager.java
+++
b/components/camel-box/camel-box-api/src/main/java/org/apache/camel/component/box/api/BoxSearchManager.java
@@ -62,7 +62,7 @@ public class BoxSearchManager {
*/
public Collection<BoxItem> searchFolder(String folderId, String query) {
try {
- LOG.debug("Searching folder(id=" + folderId + ") with query=" +
query);
+ LOG.debug("Searching folder(id={}) with query={}", folderId,
query);
if (folderId == null) {
throw new IllegalArgumentException("Parameter 'folderId' can
not be null");
@@ -90,7 +90,7 @@ public class BoxSearchManager {
return result;
} catch (BoxAPIException e) {
throw new RuntimeException(
- String.format("Box API returned the error code %d\n\n%s",
e.getResponseCode(), e.getResponse()), e);
+ String.format("Box API returned the error code %d%n%n%s",
e.getResponseCode(), e.getResponse()), e);
}
}
}
diff --git
a/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaConsumer.java
b/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaConsumer.java
index d69655f..33f96c5 100644
---
a/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaConsumer.java
+++
b/components/camel-corda/src/main/java/org/apache/camel/component/corda/CordaConsumer.java
@@ -233,7 +233,7 @@ public class CordaConsumer extends DefaultConsumer {
}
private void processError(Throwable throwable, String operation) {
- LOG.debug("processError for operation: " + operation + " " +
throwable);
+ LOG.debug("processError for operation: {} {}", operation, throwable);
Exchange exchange = createExchange(true);
exchange.setException(throwable);
processEvent(exchange);
diff --git
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
index aaf34d5..0433907 100644
---
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
+++
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
@@ -895,8 +895,8 @@ public class SftpOperations implements
RemoteFileOperations<SftpRemoteFile> {
IOHelper.close(os, "retrieve: " + name, LOG);
boolean deleted = FileUtil.deleteFile(temp);
if (!deleted) {
- LOG.warn("Error occurred during retrieving file: " + name
- + " to local directory. Cannot delete local work
file: " + temp);
+ LOG.warn("Error occurred during retrieving file: {} to local
directory. Cannot delete local work file: {}",
+ name, temp);
}
throw new GenericFileOperationFailedException("Cannot retrieve
file: " + name, e);
} finally {
diff --git
a/components/camel-jbpm/src/main/java/org/apache/camel/component/jbpm/workitem/AbstractCamelWorkItemHandler.java
b/components/camel-jbpm/src/main/java/org/apache/camel/component/jbpm/workitem/AbstractCamelWorkItemHandler.java
index eb330af..dec6edd 100644
---
a/components/camel-jbpm/src/main/java/org/apache/camel/component/jbpm/workitem/AbstractCamelWorkItemHandler.java
+++
b/components/camel-jbpm/src/main/java/org/apache/camel/component/jbpm/workitem/AbstractCamelWorkItemHandler.java
@@ -151,7 +151,7 @@ public abstract class AbstractCamelWorkItemHandler extends
AbstractLogOrThrowWor
try {
Exchange requestExchange = buildExchange(producerTemplate,
workItem);
- logger.debug("Sending Camel Exchange to: " + camelUri);
+ logger.debug("Sending Camel Exchange to: {}", camelUri);
Exchange responseExchange = producerTemplate.send(camelUri,
requestExchange);
// producerTemplate.send does not throw exceptions, instead they
are set on the returned Exchange.
if (responseExchange.getException() != null) {
diff --git
a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/cluster/lock/KubernetesLeadershipController.java
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/cluster/lock/KubernetesLeadershipController.java
index 493e60c..5252e91 100644
---
a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/cluster/lock/KubernetesLeadershipController.java
+++
b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/cluster/lock/KubernetesLeadershipController.java
@@ -316,10 +316,9 @@ public class KubernetesLeadershipController implements
Service {
this.lockConfiguration.getKubernetesResourceName(),
this.lockConfiguration.getGroupName());
} catch (Exception e) {
- LOG.warn(logPrefix() + " Unable to retrieve the current lease
resource "
- + this.lockConfiguration.getKubernetesResourceName()
- + " for group " + this.lockConfiguration.getGroupName() +
" from Kubernetes");
- LOG.debug(logPrefix() + " Exception thrown during lease resource
lookup", e);
+ LOG.warn("{} Unable to retrieve the current lease resource {} for
group {} from Kubernetes",
+ logPrefix(),
this.lockConfiguration.getKubernetesResourceName(),
this.lockConfiguration.getGroupName());
+ LOG.debug("{} Exception thrown during lease resource lookup",
logPrefix(), e);
return false;
}
@@ -327,8 +326,8 @@ public class KubernetesLeadershipController implements
Service {
try {
members = Objects.requireNonNull(pullClusterMembers(), "Retrieved
a null set of members");
} catch (Exception e) {
- LOG.warn(logPrefix() + " Unable to retrieve the list of cluster
members from Kubernetes");
- LOG.debug(logPrefix() + " Exception thrown during Pod list
lookup", e);
+ LOG.warn("{} Unable to retrieve the list of cluster members from
Kubernetes", logPrefix());
+ LOG.debug("{} Exception thrown during Pod list lookup",
logPrefix(), e);
return false;
}
@@ -344,11 +343,11 @@ public class KubernetesLeadershipController implements
Service {
LeaderInfo latestLeaderInfo = this.latestLeaderInfo;
if (latestLeaderInfo == null || members == null) {
- LOG.warn(logPrefix() + " Unexpected condition. Latest leader info
or list of members is empty.");
+ LOG.warn("{} Unexpected condition. Latest leader info or list of
members is empty.", logPrefix());
return false;
} else if (!members.contains(this.lockConfiguration.getPodName())) {
- LOG.warn(logPrefix() + " The list of cluster members " +
latestLeaderInfo.getMembers()
- + " does not contain the current Pod. Cannot yield the
leadership.");
+ LOG.warn("{} The list of cluster members {} does not contain the
current Pod. Cannot yield the leadership.",
+ logPrefix(), latestLeaderInfo.getMembers());
return false;
}
@@ -373,8 +372,8 @@ public class KubernetesLeadershipController implements
Service {
updateLatestLeaderInfo(updatedLeaseResource, members);
return true;
} catch (Exception ex) {
- LOG.warn(logPrefix() + " Unable to update the lock on the lease
resource to remove leadership information");
- LOG.debug(logPrefix() + " Error received during resource lock
replace", ex);
+ LOG.warn("{} Unable to update the lock on the lease resource to
remove leadership information", logPrefix());
+ LOG.debug("{} Error received during resource lock replace",
logPrefix(), ex);
return false;
}
}
@@ -392,11 +391,11 @@ public class KubernetesLeadershipController implements
Service {
LeaderInfo latestLeaderInfo = this.latestLeaderInfo;
if (latestLeaderInfo == null || members == null) {
- LOG.warn(logPrefix() + " Unexpected condition. Latest leader info
or list of members is empty.");
+ LOG.warn("{} Unexpected condition. Latest leader info or list of
members is empty.", logPrefix());
return false;
} else if (!members.contains(this.lockConfiguration.getPodName())) {
- LOG.warn(logPrefix() + " The list of cluster members " +
latestLeaderInfo.getMembers()
- + " does not contain the current Pod. Cannot acquire" + "
leadership.");
+ LOG.warn("{} The list of cluster members {} does not contain the
current Pod. Cannot acquire leadership.",
+ logPrefix(), latestLeaderInfo.getMembers());
return false;
}
@@ -422,10 +421,11 @@ public class KubernetesLeadershipController implements
Service {
return true;
} catch (Exception ex) {
// Suppress exception
- LOG.warn(logPrefix()
- + " Unable to create the lease resource, it may have
been created by other cluster members concurrently. If the problem persists,
check if the service account has "
- + "the right " + "permissions to create it");
- LOG.debug(logPrefix() + " Exception while trying to create the
lease resource", ex);
+ LOG.warn("{} Unable to create the lease resource, it may have
been created by other cluster members "
+ + "concurrently. If the problem persists, check if
the service account has the right permissions"
+ + " to create it",
+ logPrefix());
+ LOG.debug("{} Exception while trying to create the lease
resource", logPrefix(), ex);
return false;
}
} else {
@@ -445,8 +445,8 @@ public class KubernetesLeadershipController implements
Service {
updateLatestLeaderInfo(updatedLeaseResource, members);
return true;
} catch (Exception ex) {
- LOG.warn(logPrefix() + " Unable to update the lock lease
resource to set leadership information");
- LOG.debug(logPrefix() + " Error received during lease
resource lock replace", ex);
+ LOG.warn("{} Unable to update the lock lease resource to
set leadership information", logPrefix());
+ LOG.debug("{} Error received during lease resource lock
replace", logPrefix(), ex);
return false;
}
} else {
diff --git
a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoAbstractConsumerThread.java
b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoAbstractConsumerThread.java
index 1209d9a..5af931a 100644
---
a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoAbstractConsumerThread.java
+++
b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoAbstractConsumerThread.java
@@ -70,12 +70,11 @@ abstract class MongoAbstractConsumerThread implements
Runnable {
doRun();
} catch (Exception e) {
if (keepRunning) {
- log.warn("Exception from consuming from MongoDB caused
by " + e.getMessage()
- + ". Will try again on next poll.");
+ log.warn("Exception from consuming from MongoDB caused
by {}. Will try again on next poll.",
+ e.getMessage());
} else {
- log.warn("Exception from consuming from MongoDB caused
by " + e.getMessage()
- + ". ConsumerThread will be stopped.",
- e);
+ log.warn("Exception from consuming from MongoDB caused
by {}. ConsumerThread will be stopped.",
+ e.getMessage(), e);
}
}
// regenerate the cursor, if reading failed for some reason
diff --git
a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestModelConverters.java
b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestModelConverters.java
index 1223624..db5ffb4 100644
---
a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestModelConverters.java
+++
b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestModelConverters.java
@@ -153,7 +153,7 @@ public class RestModelConverters {
case "integer":
break;
default:
- LOG.warn("Encountered unexpected type " + type + " in
processing schema.");
+ LOG.warn("Encountered unexpected type {} in processing
schema.", type);
break;
}
}
diff --git
a/components/camel-soroush/src/main/java/org/apache/camel/component/soroushbot/component/SoroushBotAbstractConsumer.java
b/components/camel-soroush/src/main/java/org/apache/camel/component/soroushbot/component/SoroushBotAbstractConsumer.java
index c9340e7..5cda105 100644
---
a/components/camel-soroush/src/main/java/org/apache/camel/component/soroushbot/component/SoroushBotAbstractConsumer.java
+++
b/components/camel-soroush/src/main/java/org/apache/camel/component/soroushbot/component/SoroushBotAbstractConsumer.java
@@ -92,12 +92,10 @@ public abstract class SoroushBotAbstractConsumer extends
DefaultConsumer impleme
}
if (!shutdown) {
if (connectionRetry == 0) {
- if (LOG.isInfoEnabled()) {
- LOG.info("connecting to getMessage from soroush");
- }
+ LOG.info("connecting to getMessage from soroush");
} else {
if (LOG.isInfoEnabled()) {
- LOG.info("connection is closed. retrying for the "
+ ordinal(connectionRetry) + " time(s)... ");
+ LOG.info("connection is closed. retrying for the
{} time(s)... ", ordinal(connectionRetry));
}
}
}
@@ -136,9 +134,7 @@ public abstract class SoroushBotAbstractConsumer extends
DefaultConsumer impleme
try {
SoroushMessage soroushMessage =
objectMapper.readValue(data, SoroushMessage.class);
exchange.getIn().setBody(soroushMessage);
- if (LOG.isDebugEnabled()) {
- LOG.debug("event data is: " + data);
- }
+ LOG.debug("event data is: {}", data);
// if autoDownload is true, download the resource if
provided in the message
if (endpoint.isAutoDownload()) {
endpoint.handleDownloadFiles(soroushMessage);
diff --git
a/components/camel-soroush/src/main/java/org/apache/camel/component/soroushbot/component/SoroushBotEndpoint.java
b/components/camel-soroush/src/main/java/org/apache/camel/component/soroushbot/component/SoroushBotEndpoint.java
index d18d601..71f399c 100644
---
a/components/camel-soroush/src/main/java/org/apache/camel/component/soroushbot/component/SoroushBotEndpoint.java
+++
b/components/camel-soroush/src/main/java/org/apache/camel/component/soroushbot/component/SoroushBotEndpoint.java
@@ -507,8 +507,8 @@ public class SoroushBotEndpoint extends DefaultEndpoint {
multipart.bodyPart(new StreamDataBodyPart("file", inputStream,
null, MediaType.APPLICATION_OCTET_STREAM_TYPE));
try {
if (LOG.isDebugEnabled()) {
- LOG.debug("try to upload " + fileType + " for the " +
StringUtils.ordinal(count + 1) + " time for message:"
- + message);
+ LOG.debug("try to upload {} for the {} time for message:
{}", fileType,
+ StringUtils.ordinal(count + 1), message);
}
response =
getUploadFileTarget().request(MediaType.APPLICATION_JSON_TYPE)
.post(Entity.entity(multipart,
multipart.getMediaType()));
@@ -543,30 +543,24 @@ public class SoroushBotEndpoint extends DefaultEndpoint {
* @throws SoroushException if soroush reject the file
*/
void handleFileUpload(SoroushMessage message) throws SoroushException,
InterruptedException {
- if (LOG.isTraceEnabled()) {
- LOG.trace("try to upload file(s) to server if exists for message:"
+ message.toString());
- }
+ LOG.trace("try to upload file(s) to server if exists for message: {}",
message);
+
InputStream file = message.getFile();
if (file != null && (message.getFileUrl() == null || forceUpload)) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("uploading file to server for message: " + message);
- }
+ LOG.debug("uploading file to server for message: {}", message);
+
UploadFileResponse response = uploadToServer(file, message,
"file");
message.setFileUrl(response.getFileUrl());
- if (LOG.isDebugEnabled()) {
- LOG.debug("uploaded file url is: " + response.getFileUrl() + "
for message: " + message);
- }
+ LOG.debug("uploaded file url is: {} for message: {}",
response.getFileUrl(), message);
}
InputStream thumbnail = message.getThumbnail();
if (thumbnail != null && message.getThumbnailUrl() == null) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("uploading thumbnail to server for message: " +
message);
- }
+ LOG.debug("uploading thumbnail to server for message: {}",
message);
+
UploadFileResponse response = uploadToServer(thumbnail, message,
"thumbnail");
message.setThumbnailUrl(response.getFileUrl());
- if (LOG.isDebugEnabled()) {
- LOG.debug("uploaded thumbnail url is: " +
response.getFileUrl() + " for message: " + message);
- }
+
+ LOG.debug("uploaded thumbnail url is: {} for message: {}",
response.getFileUrl(), message);
}
}
@@ -579,24 +573,21 @@ public class SoroushBotEndpoint extends DefaultEndpoint {
*/
public void handleDownloadFiles(SoroushMessage message) throws
SoroushException {
if (message.getFileUrl() != null && (message.getFile() == null ||
forceDownload)) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("downloading file from server for message: " +
message);
- }
+ LOG.debug("downloading file from server for message: {}", message);
+
InputStream inputStream = downloadFromServer(message.getFileUrl(),
message, "file");
message.setFile(inputStream);
- if (LOG.isDebugEnabled()) {
- LOG.debug("file successfully downloaded for message: " +
message);
- }
+
+ LOG.debug("file successfully downloaded for message: {}", message);
+
}
if (downloadThumbnail && message.getThumbnailUrl() != null &&
(message.getThumbnail() == null || forceDownload)) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("downloading thumbnail from server for message: " +
message);
- }
+ LOG.debug("downloading thumbnail from server for message: {}",
message);
+
InputStream inputStream =
downloadFromServer(message.getThumbnailUrl(), message, "thumbnail");
message.setThumbnail(inputStream);
- if (LOG.isDebugEnabled()) {
- LOG.debug("thumbnail successfully downloaded for message: " +
message);
- }
+
+ LOG.debug("thumbnail successfully downloaded for message: {}",
message);
}
}
@@ -612,10 +603,9 @@ public class SoroushBotEndpoint extends DefaultEndpoint {
WebTarget target = getDownloadFileTarget(fileUrl);
if (LOG.isDebugEnabled()) {
if (i != 0) {
- LOG.debug("retry downloading " + type + ": " + fileUrl + "
for the " + StringUtils.ordinal(i) + " time");
+ LOG.debug("retry downloading {}: {} for the {} time",
type, fileUrl, StringUtils.ordinal(i));
}
- LOG.debug("try to download " + type + ": " + fileUrl + " with
url: " + target.getUri() + "\nfor message: "
- + message);
+ LOG.debug("try to download {}: {} with url: {}\nfor message:
{}", type, fileUrl, target.getUri(), message);
}
try {
response = target.request().get();
@@ -625,9 +615,9 @@ public class SoroushBotEndpoint extends DefaultEndpoint {
throw new MaximumConnectionRetryReachedException(
"maximum connection retry reached for " + type +
": " + fileUrl, ex, message);
}
- if (LOG.isWarnEnabled()) {
- LOG.warn("can not download " + type + ": " + fileUrl + "
from soroush. Response code is", ex);
- }
+
+ LOG.warn("can not download {}: {} from soroush. Response code
is {}", type, fileUrl, ex.getMessage());
+
}
}
//should never reach this line
diff --git
a/components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
b/components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
index 47f491b..b460b71 100644
---
a/components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
+++
b/components/camel-spring-rabbitmq/src/main/java/org/apache/camel/component/springrabbit/SpringRabbitMQEndpoint.java
@@ -598,11 +598,10 @@ public class SpringRabbitMQEndpoint extends
DefaultEndpoint implements AsyncEndp
boolean durable = parseArgsBoolean(map, "durable", "true");
boolean autoDelete = parseArgsBoolean(map, "autoDelete", "false");
if (!durable || autoDelete) {
- LOG.info("Auto-declaring a non-durable or auto-delete Exchange
("
- + exchangeName
- + ") durable:" + durable + ", auto-delete:" +
autoDelete + ". "
+ LOG.info("Auto-declaring a non-durable or auto-delete Exchange
({}) durable:{}, auto-delete:{}. "
+ "It will be deleted by the broker if it shuts down,
and can be redeclared by closing and "
- + "reopening the connection.");
+ + "reopening the connection.",
+ exchangeName, durable, autoDelete);
}
String en =
SpringRabbitMQHelper.isDefaultExchange(getExchangeName()) ? "" :
getExchangeName();
@@ -658,12 +657,10 @@ public class SpringRabbitMQEndpoint extends
DefaultEndpoint implements AsyncEndp
final Queue rabbitQueue = qb.build();
if (!durable || autoDelete || exclusive) {
- LOG.info("Auto-declaring a non-durable, auto-delete, or
exclusive Queue ("
- + rabbitQueue.getName()
- + ") durable:" + durable + ", auto-delete:" +
autoDelete + ", exclusive:"
- + exclusive + ". "
- + "It will be redeclared if the broker stops and
is restarted while the connection factory is "
- + "alive, but all messages will be lost.");
+ LOG.info("Auto-declaring a non-durable, auto-delete, or
exclusive Queue ({})"
+ + "durable:{}, auto-delete:{}, exclusive:{}. It
will be redeclared if the broker stops and "
+ + "is restarted while the connection factory is
alive, but all messages will be lost.",
+ rabbitQueue.getName(), durable, autoDelete,
exclusive);
}
String qn = admin.declareQueue(rabbitQueue);
diff --git
a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java
b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java
index 9266a62..cd56b4c 100644
---
a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java
+++
b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java
@@ -70,7 +70,7 @@ public final class CamelAnnotationsHandler {
String key = SpringCamelContext.EXCLUDE_ROUTES;
String exists = System.getProperty(key);
if (exists != null) {
- LOGGER.warn("The JVM property " + key + " is set, but not
supported anymore.");
+ LOGGER.warn("The JVM property {} is set, but not supported
anymore.", key);
}
if (testClass.isAnnotationPresent(ExcludeRoutes.class)) {
diff --git
a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoader.java
b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoader.java
index 2884069..800d5eb 100644
---
a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoader.java
+++
b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelSpringTestContextLoader.java
@@ -95,7 +95,7 @@ public class CamelSpringTestContextLoader extends
AbstractContextLoader {
Class<?> testClass = getTestClass();
if (LOG.isDebugEnabled()) {
- LOG.debug("Loading ApplicationContext for locations [" +
StringUtils.arrayToCommaDelimitedString(locations) + "].");
+ LOG.debug("Loading ApplicationContext for locations [{}].",
StringUtils.arrayToCommaDelimitedString(locations));
}
try {
@@ -191,9 +191,9 @@ public class CamelSpringTestContextLoader extends
AbstractContextLoader {
if (excludedClasses.length > 0) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Setting up package scanning excluded classes as
ExcludeRoutes "
- + "annotation was found. Excluding [" +
StringUtils.arrayToCommaDelimitedString(excludedClasses)
- + "].");
+ LOG.debug(
+ "Setting up package scanning excluded classes as
ExcludeRoutes annotation was found. Excluding [{}]",
+
StringUtils.arrayToCommaDelimitedString(excludedClasses));
}
if (parentContext == null) {
diff --git
a/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java
b/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java
index a162abf..34dbfd8 100644
---
a/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java
+++
b/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java
@@ -70,7 +70,7 @@ public final class CamelAnnotationsHandler {
String key = SpringCamelContext.EXCLUDE_ROUTES;
String exists = System.getProperty(key);
if (exists != null) {
- LOGGER.warn("The JVM property " + key + " is set, but not
supported anymore.");
+ LOGGER.warn("The JVM property {} is set, but not supported
anymore.", key);
}
if (testClass.isAnnotationPresent(ExcludeRoutes.class)) {
diff --git
a/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
b/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
index b808b6d..f452a7a 100644
---
a/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
+++
b/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
@@ -90,7 +90,7 @@ public class CamelSpringTestContextLoader extends
AbstractContextLoader {
Class<?> testClass = getTestClass();
if (LOG.isDebugEnabled()) {
- LOG.debug("Loading ApplicationContext for locations [" +
StringUtils.arrayToCommaDelimitedString(locations) + "].");
+ LOG.debug("Loading ApplicationContext for locations [{}].",
StringUtils.arrayToCommaDelimitedString(locations));
}
try {
@@ -180,9 +180,9 @@ public class CamelSpringTestContextLoader extends
AbstractContextLoader {
if (excludedClasses.length > 0) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Setting up package scanning excluded classes as
ExcludeRoutes "
- + "annotation was found. Excluding [" +
StringUtils.arrayToCommaDelimitedString(excludedClasses)
- + "].");
+ LOG.debug(
+ "Setting up package scanning excluded classes as
ExcludeRoutes annotation was found. Excluding [{}].",
+
StringUtils.arrayToCommaDelimitedString(excludedClasses));
}
if (parentContext == null) {
diff --git
a/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
b/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
index 0f462de..fd83f71 100644
---
a/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
+++
b/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java
@@ -299,7 +299,7 @@ public abstract class CamelTestSupport extends TestSupport {
@Before
public void setUp() throws Exception {
LOG.info("********************************************************************************");
- LOG.info("Testing: " + getTestMethodName() + "(" +
getClass().getName() + ")");
+ LOG.info("Testing: {} ({})", getTestMethodName(),
getClass().getName());
LOG.info("********************************************************************************");
if (isCreateCamelContextPerClass()) {
@@ -445,7 +445,7 @@ public abstract class CamelTestSupport extends TestSupport {
if (isUseRouteBuilder()) {
RoutesBuilder[] builders = createRouteBuilders();
for (RoutesBuilder builder : builders) {
- LOG.debug("Using created route builder: " + builder);
+ LOG.debug("Using created route builder: {}", builder);
context.addRoutes(builder);
}
replaceFromEndpoints();
@@ -459,9 +459,9 @@ public abstract class CamelTestSupport extends TestSupport {
}
} else {
replaceFromEndpoints();
- LOG.debug("Using route builder from the created context: " +
context);
+ LOG.debug("Using route builder from the created context: {}",
context);
}
- LOG.debug("Routing Rules are: " + context.getRoutes());
+ LOG.debug("Routing Rules are: {}", context.getRoutes());
assertValidContext(context);
}
@@ -486,8 +486,8 @@ public abstract class CamelTestSupport extends TestSupport {
long time = watch.taken();
LOG.info("********************************************************************************");
- LOG.info("Testing done: " + getTestMethodName() + "(" +
getClass().getName() + ")");
- LOG.info("Took: " + TimeUtils.printDuration(time) + " (" + time + "
millis)");
+ LOG.info("Testing done: {} ({})", getTestMethodName(),
getClass().getName());
+ LOG.info("Took: {} ({} millis)", TimeUtils.printDuration(time), time);
// if we should dump route stats, then write that to a file
if (isRouteCoverageEnabled()) {
diff --git
a/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
b/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
index 1f0d441..c5f01d9 100644
---
a/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
+++
b/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java
@@ -218,7 +218,7 @@ public abstract class TestSupport extends Assert {
try {
PredicateAssertHelper.assertMatches(predicate, "Predicate should
match: ", exchange);
} catch (AssertionError e) {
- LOG.debug("Caught expected assertion error: {}", e);
+ LOG.debug("Caught expected assertion error: {}", e.getMessage(),
e);
}
assertPredicate(predicate, exchange, false);
}
diff --git
a/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jConsumer.java
b/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jConsumer.java
index 1cbc8ff..b88a7b4 100644
---
a/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jConsumer.java
+++
b/components/camel-web3j/src/main/java/org/apache/camel/component/web3j/Web3jConsumer.java
@@ -219,7 +219,7 @@ public class Web3jConsumer extends DefaultConsumer {
}
private void processError(Throwable throwable, String operation) {
- LOG.debug("processError for operation: " + operation + " " +
throwable);
+ LOG.debug("processError for operation: {} {}", operation,
throwable.getMessage(), throwable);
Exchange exchange = this.getEndpoint().createExchange();
exchange.setException(throwable);
processEvent(exchange);
diff --git
a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/MasterConsumer.java
b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/MasterConsumer.java
index 110318e..dbbc238 100644
---
a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/MasterConsumer.java
+++
b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/MasterConsumer.java
@@ -96,8 +96,8 @@ public class MasterConsumer extends DefaultConsumer {
this.groupListener.setMaximumConnectionTimeout(endpoint.getComponent().getMaximumConnectionTimeout());
ServiceHelper.startService(groupListener);
- LOG.info("Attempting to become master for endpoint: " + endpoint + "
in " + endpoint.getCamelContext()
- + " with singletonID: " + endpoint.getGroupName());
+ LOG.info("Attempting to become master for endpoint: {} in {} with
singletonID: {}", endpoint,
+ endpoint.getCamelContext(), endpoint.getGroupName());
thisNodeState = createNodeState();
groupListener.updateState(thisNodeState);
}
diff --git
a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java
b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java
index 07e360b..08f9545 100644
---
a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java
+++
b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java
@@ -155,7 +155,7 @@ public class ZooKeeperGroup<T extends NodeState> implements
Group<T> {
* @param executorService ExecutorService to use for the ZooKeeperGroup's
background thread
*/
public ZooKeeperGroup(CuratorFramework client, String path, Class<T>
clazz, final ExecutorService executorService) {
- LOG.info("Creating ZK Group for path \"" + path + "\"");
+ LOG.info("Creating ZK Group for path \"{}\"", path);
this.client = client;
this.path = path;
this.clazz = clazz;
@@ -193,7 +193,7 @@ public class ZooKeeperGroup<T extends NodeState> implements
Group<T> {
*/
@Override
public void close() throws IOException {
- LOG.debug(this + ".close, connected:" + connected);
+ LOG.debug("{}.close, connected:{}", this, connected);
if (started.compareAndSet(true, false)) {
client.getConnectionStateListenable().removeListener(connectionStateListener);
executorService.shutdownNow();
@@ -254,7 +254,7 @@ public class ZooKeeperGroup<T extends NodeState> implements
Group<T> {
protected void doUpdate(T state) throws Exception {
if (LOG.isTraceEnabled()) {
// state.toString() invokes Jackson ObjectMapper serialization
- LOG.trace(this + " doUpdate, state:" + state + " id:" + id);
+ LOG.trace("{} doUpdate, state:{} id:{}", this, state, id);
}
if (state == null) {
if (id != null) {
@@ -299,7 +299,7 @@ public class ZooKeeperGroup<T extends NodeState> implements
Group<T> {
unstable.set(false);
if (LOG.isTraceEnabled()) {
// state.toString() invokes Jackson ObjectMapper serialization
- LOG.trace(this + ", state:" + state + ", new ephemeralSequential
path:" + pathId);
+ LOG.trace("{}, state:{}, new ephemeralSequential path:{}", this,
state, pathId);
}
prunePartialState(state, pathId);
state.uuid = null;
diff --git
a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/policy/MasterRoutePolicy.java
b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/policy/MasterRoutePolicy.java
index b45a163..3abbb0c 100644
---
a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/policy/MasterRoutePolicy.java
+++
b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/policy/MasterRoutePolicy.java
@@ -224,8 +224,8 @@ public class MasterRoutePolicy extends RoutePolicySupport
implements CamelContex
this.groupListener.setZooKeeperPassword(zooKeeperPassword);
ServiceHelper.startService(groupListener);
- LOG.info("Attempting to become master for endpoint: " +
route.getEndpoint() + " in " + getCamelContext()
- + " with singletonID: " + getGroupName());
+ LOG.info("Attempting to become master for endpoint: {} in {} with
singletonID: {}", route.getEndpoint(),
+ getCamelContext(), getGroupName());
thisNodeState = createNodeState();
groupListener.updateState(thisNodeState);
}
diff --git
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
index 03d98f3..6d0c86d 100644
---
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
+++
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
@@ -2675,11 +2675,11 @@ public abstract class AbstractCamelContext extends
BaseService
strategy.onContextInitializing(this);
} catch (VetoCamelContextStartException e) {
// okay we should not start Camel since it was vetoed
- LOG.warn("Lifecycle strategy " + strategy + " vetoed
initializing CamelContext ({}) due to: {}", getName(),
+ LOG.warn("Lifecycle strategy {} vetoed initializing
CamelContext ({}) due to: {}", strategy, getName(),
e.getMessage());
throw e;
} catch (Exception e) {
- LOG.warn("Lifecycle strategy " + strategy + " failed
initializing CamelContext ({}) due to: {}", getName(),
+ LOG.warn("Lifecycle strategy {} failed initializing
CamelContext ({}) due to: {}", strategy, getName(),
e.getMessage());
throw e;
}
@@ -2765,11 +2765,11 @@ public abstract class AbstractCamelContext extends
BaseService
strategy.onContextInitialized(this);
} catch (VetoCamelContextStartException e) {
// okay we should not start Camel since it was vetoed
- LOG.warn("Lifecycle strategy " + strategy + " vetoed
initializing CamelContext ({}) due to: {}", getName(),
+ LOG.warn("Lifecycle strategy {} vetoed initializing
CamelContext ({}) due to: {}", strategy, getName(),
e.getMessage());
throw e;
} catch (Exception e) {
- LOG.warn("Lifecycle strategy " + strategy + " failed
initializing CamelContext ({}) due to: {}", getName(),
+ LOG.warn("Lifecycle strategy {} failed initializing
CamelContext ({}) due to: {}", strategy, getName(),
e.getMessage());
throw e;
}
@@ -3053,11 +3053,11 @@ public abstract class AbstractCamelContext extends
BaseService
strategy.onContextStart(this);
} catch (VetoCamelContextStartException e) {
// okay we should not start Camel since it was vetoed
- LOG.warn("Lifecycle strategy " + strategy + " vetoed
starting CamelContext ({}) due to: {}", getName(),
+ LOG.warn("Lifecycle strategy {} vetoed starting
CamelContext ({}) due to: {}", strategy, getName(),
e.getMessage());
throw e;
} catch (Exception e) {
- LOG.warn("Lifecycle strategy " + strategy + " failed
starting CamelContext ({}) due to: {}", getName(),
+ LOG.warn("Lifecycle strategy {} failed starting
CamelContext ({}) due to: {}", strategy, getName(),
e.getMessage());
throw e;
}
@@ -3998,7 +3998,7 @@ public abstract class AbstractCamelContext extends
BaseService
LifecycleStrategy lifecycle = factory.createLifecycle(this);
factory.setupManagement(this, strategy, lifecycle);
} catch (Exception e) {
- LOG.warn("Error setting up management due " + e.getMessage());
+ LOG.warn("Error setting up management due {}", e.getMessage());
throw RuntimeCamelException.wrapRuntimeCamelException(e);
}
}
diff --git
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultShutdownStrategy.java
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultShutdownStrategy.java
index 003b703..0289f64 100644
---
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultShutdownStrategy.java
+++
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultShutdownStrategy.java
@@ -388,9 +388,8 @@ public class DefaultShutdownStrategy extends ServiceSupport
implements ShutdownS
// it has completed its current task
ShutdownRunningTask current =
order.getRoute().getShutdownRunningTask();
if (current != ShutdownRunningTask.CompleteCurrentTaskOnly) {
- LOG.debug("Changing shutdownRunningTask from {} to " +
ShutdownRunningTask.CompleteCurrentTaskOnly
- + " on route {} to shutdown faster",
- current, order.getRoute().getId());
+ LOG.debug("Changing shutdownRunningTask from {} to {} on route
{} to shutdown faster",
+ ShutdownRunningTask.CompleteCurrentTaskOnly, current,
order.getRoute().getId());
order.getRoute().setShutdownRunningTask(ShutdownRunningTask.CompleteCurrentTaskOnly);
}
@@ -639,8 +638,8 @@ public class DefaultShutdownStrategy extends ServiceSupport
implements ShutdownS
// we will stop it later, but for now it must run to be
able to help all inflight messages
// be safely completed
deferredConsumers.add(new
ShutdownDeferredConsumer(order.getRoute(), consumer));
- LOG.debug("Route: " + order.getRoute().getId()
- + (suspendOnly ? " shutdown deferred." : "
suspension deferred."));
+ LOG.debug("Route: {} {}", order.getRoute().getId(),
+ suspendOnly ? "shutdown deferred." : "suspension
deferred.");
}
}
diff --git
a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
index 3eb6563..ea712e2 100644
---
a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
+++
b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
@@ -617,14 +617,13 @@ public class PropertiesComponent extends ServiceSupport
LOG.info("PropertiesComponent added custom
PropertiesSource (factory): {}", ps);
} else if (obj != null) {
LOG.warn(
- "PropertiesComponent cannot add custom
PropertiesSource as the type is not a
org.apache.camel.component.properties.PropertiesSource but: "
- + type.getName());
+ "PropertiesComponent cannot add custom
PropertiesSource as the type is not a {} but: {}",
+ PropertiesSource.class.getName(),
type.getName());
}
}
} catch (Exception e) {
- LOG.debug("Error discovering and using custom PropertiesSource
due to " + e.getMessage()
- + ". This exception is ignored",
- e);
+ LOG.debug("Error discovering and using custom PropertiesSource
due to {}. This exception is ignored",
+ e.getMessage(), e);
}
}
diff --git
a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 20a7a1f..8544303 100644
---
a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++
b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -152,9 +152,9 @@ public class DefaultCamelContext extends SimpleCamelContext
implements ModelCame
xml = StringHelper.replaceFirst(xml,
"xmlns=\"http://camel.apache.org/schema/spring\">",
"xmlns=\"http://camel.apache.org/schema/spring\">\n");
xml = StringHelper.replaceAll(xml, "</route>", "</route>\n");
- LOG.info("\n\n" + xml + "\n");
+ LOG.info("\n\n{}\n", xml);
} catch (Exception e) {
- LOG.warn("Error dumping routes to XML due to " +
e.getMessage() + ". This exception is ignored.", e);
+ LOG.warn("Error dumping routes to XML due to {}. This
exception is ignored.", e.getMessage(), e);
}
}
@@ -170,9 +170,9 @@ public class DefaultCamelContext extends SimpleCamelContext
implements ModelCame
xml = StringHelper.replaceFirst(xml,
"xmlns=\"http://camel.apache.org/schema/spring\">",
"xmlns=\"http://camel.apache.org/schema/spring\">\n");
xml = StringHelper.replaceAll(xml, "</rest>", "</rest>\n");
- LOG.info("\n\n" + xml + "\n");
+ LOG.info("\n\n{}\n", xml);
} catch (Exception e) {
- LOG.warn("Error dumping rests to XML due to " + e.getMessage()
+ ". This exception is ignored.", e);
+ LOG.warn("Error dumping rests to XML due to {}. This exception
is ignored.", e.getMessage(), e);
}
}
@@ -188,9 +188,9 @@ public class DefaultCamelContext extends SimpleCamelContext
implements ModelCame
xml = StringHelper.replaceFirst(xml,
"xmlns=\"http://camel.apache.org/schema/spring\">",
"xmlns=\"http://camel.apache.org/schema/spring\">\n");
xml = StringHelper.replaceAll(xml, "</routeTemplate>",
"</routeTemplate>\n");
- LOG.info("\n\n" + xml + "\n");
+ LOG.info("\n\n{}\n", xml);
} catch (Exception e) {
- LOG.warn("Error dumping route-templates to XML due to " +
e.getMessage() + ". This exception is ignored.", e);
+ LOG.warn("Error dumping route-templates to XML due to {}. This
exception is ignored.", e.getMessage(), e);
}
}
}
diff --git
a/core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
b/core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
index df146c3..76a78a9 100644
---
a/core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
+++
b/core/camel-core-processor/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java
@@ -1395,9 +1395,9 @@ public class AggregateProcessor extends
AsyncProcessorSupport
// if we are exhausted, then move to dead letter
channel
if (data != null &&
recoverable.getMaximumRedeliveries() > 0
&& data.redeliveryCounter >=
recoverable.getMaximumRedeliveries()) {
- LOG.warn("The recovered exchange is exhausted
after " + recoverable.getMaximumRedeliveries()
- + " attempts, will now be moved to
dead letter channel: "
- + recoverable.getDeadLetterUri());
+ LOG.warn("The recovered exchange is exhausted
after {} attempts, will now be moved to "
+ + "dead letter channel: {}",
+ recoverable.getMaximumRedeliveries(),
recoverable.getDeadLetterUri());
// send to DLC
try {
diff --git
a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
index 16740f3..26a0648 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
@@ -991,7 +991,7 @@ public abstract class BaseMainSupport extends BaseService {
if (hc == null) {
hc = hcr.resolveById(parent);
if (hc == null) {
- LOG.warn("Cannot resolve HealthCheck with id: " + parent +
" from classpath.");
+ LOG.warn("Cannot resolve HealthCheck with id: {} from
classpath.", parent);
continue;
}
hcr.register(hc);
diff --git
a/core/camel-management/src/main/java/org/apache/camel/management/JmxManagementLifecycleStrategy.java
b/core/camel-management/src/main/java/org/apache/camel/management/JmxManagementLifecycleStrategy.java
index 943584f..b415b93 100644
---
a/core/camel-management/src/main/java/org/apache/camel/management/JmxManagementLifecycleStrategy.java
+++
b/core/camel-management/src/main/java/org/apache/camel/management/JmxManagementLifecycleStrategy.java
@@ -204,9 +204,9 @@ public class JmxManagementLifecycleStrategy extends
ServiceSupport implements Li
+ " Make sure
to use unique names on CamelContext when using multiple CamelContexts in the
same MBeanServer.",
context);
} else {
- LOG.warn("This CamelContext(" + context.getName() + ")
will be registered using the name: "
- + managementName
- + " due to clash with an existing name
already registered in MBeanServer.");
+ LOG.warn("This CamelContext({}) will be registered
using the name: {} due to clash with an "
+ + "existing name already registered in
MBeanServer.",
+ context.getName(), managementName);
}
}
}
diff --git
a/core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java
b/core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java
index e5e6e0e..a4adf63 100644
---
a/core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java
+++
b/core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java
@@ -168,9 +168,9 @@ public class InMemorySagaCoordinator implements
CamelSagaCoordinator {
}
return result.whenComplete((done, ex) -> {
if (ex != null) {
- LOG.error("Cannot finalize " + description + " the saga", ex);
+ LOG.error("Cannot finalize {} the saga", description, ex);
} else if (!done) {
- LOG.warn("Unable to finalize " + description + " for all
required steps of the saga " + sagaId);
+ LOG.warn("Unable to finalize {} for all required steps of the
saga {}", description, sagaId);
}
});
}
@@ -186,9 +186,8 @@ public class InMemorySagaCoordinator implements
CamelSagaCoordinator {
}
return true;
}, sagaService.getExecutorService()).exceptionally(ex -> {
- LOG.warn("Exception thrown during " + description + " at " +
endpoint.getEndpointUri()
- + ". Attempt " + (doneAttempts + 1) + " of " +
sagaService.getMaxRetryAttempts(),
- ex);
+ LOG.warn("Exception thrown during {} at {}. Attempt {} of {}",
description, endpoint.getEndpointUri(),
+ doneAttempts + 1, sagaService.getMaxRetryAttempts(), ex);
return false;
}).thenCompose(executed -> {
int currentAttempt = doneAttempts + 1;
diff --git
a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
index 47e7cc9..24f4b89 100644
---
a/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
+++
b/tooling/maven/camel-api-component-maven-plugin/src/main/java/org/apache/camel/maven/AbstractGeneratorMojo.java
@@ -128,7 +128,7 @@ public abstract class AbstractGeneratorMojo extends
AbstractMojo {
URL[] urls = project.getTestClasspathElements().stream()
.map(File::new)
.map(ThrowingHelper.wrapAsFunction(e -> e.toURI().toURL()))
- .peek(url -> log.debug("Adding project path " + url))
+ .peek(url -> log.debug("Adding project path {}", url))
.toArray(URL[]::new);
// if there are no urls then its because we are testing ourselves,
then add the urls for source so java source parser can find them