Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,7 @@ public Object before(Exchange exchange) throws Exception {
policy.onExchangeBegin(route, exchange);
}
} catch (Exception e) {
log.warn("Error occurred during onExchangeBegin on RoutePolicy: " + policy
+ ". This exception will be ignored",
log.warn("Error occurred during onExchangeBegin on RoutePolicy: {}. This exception will be ignored", policy,
e);
}
}
Expand All @@ -530,9 +529,8 @@ public void after(Exchange exchange, Object data) throws Exception {
policy.onExchangeDone(route, exchange);
}
} catch (Exception e) {
log.warn("Error occurred during onExchangeDone on RoutePolicy: " + policy
+ ". This exception will be ignored",
e);
log.warn("Error occurred during onExchangeDone on RoutePolicy: {}. This exception will be ignored",
policy, e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ protected void doStop() throws Exception {
try {
interrupt(entry.getExchange());
} catch (Throwable e) {
LOG.warn("Error while interrupting thread: " + entry.getBlockedThread().getName()
+ ". This exception is ignored.",
LOG.warn("Error while interrupting thread: {}. This exception is ignored.",
entry.getBlockedThread().getName(),
e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ protected List<String> doLoadImplementationsInJar(

}
} catch (IOException ioe) {
LOG.warn("Cannot search jar file '" + urlPath + " due to an IOException: " + ioe.getMessage(), ioe);
LOG.warn("Cannot search jar file '{} due to an IOException: {}", urlPath, ioe.getMessage(), ioe);
} finally {
IOHelper.close(jarStream, urlPath, LOG);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ protected void shutdownNow(String routeId, Consumer consumer) {
try {
ServiceHelper.stopService(consumer);
} catch (Throwable e) {
LOG.warn("Error occurred while shutting down route: " + routeId + ". This exception will be ignored.", e);
LOG.warn("Error occurred while shutting down route: {}. This exception will be ignored.", routeId, e);
// fire event
EventHelper.notifyServiceStopFailure(consumer.getEndpoint().getCamelContext(), consumer, e);
}
Expand All @@ -453,7 +453,7 @@ protected void suspendNow(String routeId, Consumer consumer) {
try {
ServiceHelper.suspendService(consumer);
} catch (Throwable e) {
LOG.warn("Error occurred while suspending route: " + routeId + ". This exception will be ignored.", e);
LOG.warn("Error occurred while suspending route: {}. This exception will be ignored.", routeId, e);
// fire event
EventHelper.notifyServiceStopFailure(consumer.getEndpoint().getCamelContext(), consumer, e);
}
Expand Down Expand Up @@ -518,9 +518,9 @@ private void prepareShutdown(
((ShutdownPrepared) child).prepareShutdown(suspendOnly, forced);
} catch (Exception e) {
if (suppressLogging) {
LOG.trace("Error during prepare shutdown on " + child + ". This exception will be ignored.", e);
LOG.trace("Error during prepare shutdown on {}. This exception will be ignored.", child, e);
} else {
LOG.warn("Error during prepare shutdown on " + child + ". This exception will be ignored.", e);
LOG.warn("Error during prepare shutdown on {}. This exception will be ignored.", child, e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ public static class MyOrderService {
* We just handle the order by returning an id line for the order
*/
public String handleOrder(String line) {
LOG.debug("HandleOrder: " + line);
LOG.debug("HandleOrder: {}", line);
return "(id=" + ++counter + ",item=" + line + ")";
}

Expand All @@ -689,7 +689,7 @@ public static class MyOrderService {
* back to the original caller
*/
public String buildCombinedResponse(String line) {
LOG.debug("BuildCombinedResponse: " + line);
LOG.debug("BuildCombinedResponse: {}", line);
return "Response[" + line + "]";
}
}
Expand Down Expand Up @@ -721,8 +721,8 @@ public static class MyOrderStrategy implements AggregationStrategy {
String orders = oldExchange.getIn().getBody(String.class);
String newLine = newExchange.getIn().getBody(String.class);

LOG.debug("Aggregate old orders: " + orders);
LOG.debug("Aggregate new order: " + newLine);
LOG.debug("Aggregate old orders: {}", orders);
LOG.debug("Aggregate new order: {}", newLine);

// put orders together separating by semicolon
orders = orders + ";" + newLine;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ protected void doDone(
processorExchangeFactory.release(pair.getExchange());
}
} catch (Throwable e) {
LOG.warn("Error releasing exchange due to " + e.getMessage() + ". This exception is ignored.", e);
LOG.warn("Error releasing exchange due to {}. This exception is ignored.", e.getMessage(), e);
}
}
// we are done so close the pairs iterator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ private boolean isValid(Exchange exchange) {
try {
result = expression.evaluate(exchange, Object.class);
} catch (Exception e) {
LOG.debug("Error evaluating expression: " + expression + ". This exception is ignored.", e);
LOG.debug("Error evaluating expression: {}. This exception is ignored.", expression, e);
}
return result != null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public boolean process(Exchange exchange, final AsyncCallback callback) {
} 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);
Expand Down Expand Up @@ -342,9 +342,8 @@ protected void doInit() throws Exception {
} catch (Throwable e) {
// ignore
if (LOG.isDebugEnabled()) {
LOG.debug("Error creating optimised SendDynamicAwareResolver for uri: " + URISupport.sanitizeUri(uri)
+ " due to " + e.getMessage() + ". This exception is ignored",
e);
LOG.debug("Error creating optimised SendDynamicAwareResolver for uri: {} due to {}. This exception is ignored",
URISupport.sanitizeUri(uri), e.getMessage(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,8 @@ public static boolean setPropertiesOnTarget(
throw new PropertyBindingException(
e.getTarget(), e.getPropertyName(), e.getValue(), optionPrefix, key, e.getCause());
} else {
LOG.debug("Error configuring property (" + key + ") with name: " + e.getPropertyName() + ") on bean: " + target
+ " with value: " + e.getValue() + ". This exception is ignored as failIfNotSet=false.",
e);
LOG.debug("Error configuring property ({}) with name: {}) on bean: {} with value: {}. This exception is ignored as failIfNotSet=false.",
key, e.getPropertyName(), target, e.getValue(), e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void internalBeforeStop() {
camelTemplate = null;
}
} catch (Exception e) {
LOG.debug("Error stopping camelTemplate due " + e.getMessage() + ". This exception is ignored.", e);
LOG.debug("Error stopping camelTemplate due {}. This exception is ignored.", e.getMessage(), e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ public void onEndpointAdd(Endpoint endpoint) {
}
manageObject(me);
} catch (Exception e) {
LOG.warn("Could not register Endpoint MBean for endpoint: " + endpoint + ". This exception will be ignored.", e);
LOG.warn("Could not register Endpoint MBean for endpoint: {}. This exception will be ignored.", endpoint, e);
}
}

Expand All @@ -427,7 +427,7 @@ public void onEndpointRemove(Endpoint endpoint) {
Object me = getManagementObjectStrategy().getManagedObjectForEndpoint(camelContext, endpoint);
unmanageObject(me);
} catch (Exception e) {
LOG.warn("Could not unregister Endpoint MBean for endpoint: " + endpoint + ". This exception will be ignored.", e);
LOG.warn("Could not unregister Endpoint MBean for endpoint: {}. This exception will be ignored.", endpoint, e);
}
}

Expand Down Expand Up @@ -462,7 +462,7 @@ public void onServiceAdd(CamelContext context, Service service, Route route) {
try {
manageObject(managedObject);
} catch (Exception e) {
LOG.warn("Could not register service: " + service + " as Service MBean.", e);
LOG.warn("Could not register service: {} as Service MBean.", service, e);
}
}

Expand All @@ -478,7 +478,7 @@ public void onServiceRemove(CamelContext context, Service service, Route route)
try {
unmanageObject(managedObject);
} catch (Exception e) {
LOG.warn("Could not unregister service: " + service + " as Service MBean.", e);
LOG.warn("Could not unregister service: {} as Service MBean.", service, e);
}
}
}
Expand Down Expand Up @@ -716,7 +716,7 @@ public void onThreadPoolAdd(
// we need to keep track here, as we cannot re-construct the thread pool ObjectName when removing the thread pool
managedThreadPools.put(threadPool, mtp);
} catch (Exception e) {
LOG.warn("Could not register thread pool: " + threadPool + " as ThreadPool MBean.", e);
LOG.warn("Could not register thread pool: {} as ThreadPool MBean.", threadPool, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void configure() throws Exception {

@Override
public void process(Exchange exchange) throws Exception {
log.info("Some: " + counter);
log.info("Some: {}", counter);

exchange.setProperty("EXIT", "NO");
StringBuilder sb = new StringBuilder();
Expand All @@ -80,9 +80,9 @@ public void process(Exchange exchange) throws Exception {
}

public String slip(String body, @ExchangeProperties Map<String, Object> properties) {
log.info("slip " + properties.get("EXIT"));
log.info("slip {}", properties.get("EXIT"));
if (properties.get("EXIT") != null && properties.get("EXIT").equals("PLEASE")) {
log.info("Exiting after " + MAX_ITERATIONS + " iterations");
log.info("Exiting after {} iterations", MAX_ITERATIONS);
return null;
} else {
return "direct:while_body";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private class MyNotificationListener implements NotificationListener {

@Override
public void handleNotification(Notification notification, Object handback) {
log.debug("Get the notification : " + notification);
log.debug("Get the notification : {}", notification);
eventCounter++;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public boolean process(Exchange exchange, AsyncCallback callback) {
throw new IllegalArgumentException("Forced to dump stacktrace");
} catch (Exception e) {
e.fillInStackTrace();
LOG.info("There are " + e.getStackTrace().length + " lines in the stacktrace");
LOG.info("There are {} lines in the stacktrace", e.getStackTrace().length);
LOG.error("Dump stacktrace to log", e);
}
callback.done(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void configure() throws Exception {
throw new IllegalArgumentException("Forced to dump stacktrace");
} catch (Exception e) {
e.fillInStackTrace();
log.info("There are " + e.getStackTrace().length + " lines in the stacktrace");
log.info("There are {} lines in the stacktrace", e.getStackTrace().length);
log.error("Dump stacktrace to log", e);
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void onReload(Object source) {
EventHelper.notifyContextReloaded(getCamelContext(), source);
} catch (Exception e) {
incFailedCounter();
LOG.warn("Error reloading CamelContext (" + camelContext.getName() + ") due to: " + e.getMessage(), e);
LOG.warn("Error reloading CamelContext ({}) due to: {}", camelContext.getName(), e.getMessage(), e);
EventHelper.notifyContextReloadFailure(getCamelContext(), source, e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ private static boolean doNotifyEvent(EventNotifier notifier, CamelEvent event) {
try {
notifier.notify(event);
} catch (Throwable e) {
LOG.warn("Error notifying event " + event + ". This exception will be ignored.", e);
LOG.warn("Error notifying event {}. This exception will be ignored.", event, e);
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,8 @@ public void run() {
incSucceededCounter();
} catch (Exception e) {
incFailedCounter();
LOG.warn("Error reloading routes from file: " + name + " due " + e.getMessage()
+ ". This exception is ignored.",
e);
LOG.warn("Error reloading routes from file: {} due to {}. This exception is ignored.", name,
e.getMessage(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ public void onReload(Object source) {
incSucceededCounter();
} catch (Exception e) {
incFailedCounter();
LOG.warn("Error reloading routes due " + e.getMessage()
+ ". This exception is ignored.",
e);
LOG.warn("Error reloading routes due to {}. This exception is ignored.", e.getMessage(), e);
} finally {
if (cl != null) {
Thread.currentThread().setContextClassLoader(cl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ public static void loadRouteTemplateFromLocation(
listener.loadRouteTemplate(res);
}
} catch (Exception e) {
LOG.warn("RouteTemplateLoaderListener error due to " + e.getMessage()
+ ". This exception is ignored",
e);
LOG.warn("RouteTemplateLoaderListener error due to {}. This exception is ignored", e.getMessage(), e);
}
PluginHelper.getRoutesLoader(camelContext).loadRoutes(res);
found = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected void setDisabled(String partition, boolean disabled) {
view.setDisabled(disabled);
}
} catch (Exception ex) {
LOG.warn("Could not get view " + partition, ex);
LOG.warn("Could not get view {}", partition, ex);
}
}

Expand All @@ -176,7 +176,7 @@ protected List<String> owned(List<String> partitions) {
owned.add(partition);
}
} catch (Exception ex) {
LOG.warn("Could not get view " + partition, ex);
LOG.warn("Could not get view {}", partition, ex);
return null;
}
}
Expand All @@ -201,7 +201,7 @@ protected Integer members() {
}
members = viewMembers;
} catch (Exception ex) {
LOG.warn("Could not get view " + group, ex);
LOG.warn("Could not get view {}", group, ex);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public static void force(FileChannel channel, String name, Logger log) {
log = LOG;
}
if (name != null) {
log.warn("Cannot force FileChannel: " + name + ". Reason: " + e.getMessage(), e);
log.warn("Cannot force FileChannel: {}. Reason: {}", name, e.getMessage(), e);
} else {
log.warn("Cannot force FileChannel. Reason: {}", e.getMessage(), e);
}
Expand All @@ -302,7 +302,7 @@ public static void force(FileOutputStream os, String name, Logger log) {
log = LOG;
}
if (name != null) {
log.warn("Cannot sync FileDescriptor: " + name + ". Reason: " + e.getMessage(), e);
log.warn("Cannot sync FileDescriptor: {}. Reason: {}", name, e.getMessage(), e);
} else {
log.warn("Cannot sync FileDescriptor. Reason: {}", e.getMessage(), e);
}
Expand Down Expand Up @@ -331,7 +331,7 @@ public static void close(Writer writer, FileOutputStream os, String name, Logger
log = LOG;
}
if (name != null) {
log.warn("Cannot flush Writer: " + name + ". Reason: " + e.getMessage(), e);
log.warn("Cannot flush Writer: {}. Reason: {}", name, e.getMessage(), e);
} else {
log.warn("Cannot flush Writer. Reason: {}", e.getMessage(), e);
}
Expand Down Expand Up @@ -359,7 +359,7 @@ public static void close(Closeable closeable, String name, Logger log) {
log = LOG;
}
if (name != null) {
log.warn("Cannot close: " + name + ". Reason: " + e.getMessage(), e);
log.warn("Cannot close: {}. Reason: {}", name, e.getMessage(), e);
} else {
log.warn("Cannot close. Reason: {}", e.getMessage(), e);
}
Expand Down