Fix bug where exception message is not included in log entry
@@ -319,12 +319,12 @@ class IOThread implements Runnable, AutoCloseable {
successfullHandshakes.getAndIncrement();
} catch (ServerResponseException ser) {
executeProblemsCounter.incrementAndGet();
- log.log(Level.INFO, "Handshake did not work out " + endpoint, Exceptions.toMessageString(ser));
+ log.log(Level.INFO, "Handshake did not work out {0}: {1}", new Object[] {endpoint, Exceptions.toMessageString(ser)});
drainFirstDocumentsInQueueIfOld();
return ThreadState.CONNECTED;
} catch (Throwable throwable) { // This cover IOException as well
executeProblemsCounter.incrementAndGet();
- log.log(Level.INFO, "Problem with Handshake " + endpoint, Exceptions.toMessageString(throwable));
+ log.log(Level.INFO, "Problem with Handshake {0}: {1}", new Object[] {endpoint, Exceptions.toMessageString(throwable)});
drainFirstDocumentsInQueueIfOld();
client.close();
return ThreadState.DISCONNECTED;
@@ -336,11 +336,11 @@ class IOThread implements Runnable, AutoCloseable {
gatewayThrottler.handleCall(processResponse.transitiveErrorCount);
}
catch (ServerResponseException ser) {
- log.info("Problems while handing data over to gateway " + endpoint + ": " + Exceptions.toMessageString(ser));
+ log.log(Level.INFO, "Problems while handing data over to gateway {0}: {1}", new Object[] {endpoint, Exceptions.toMessageString(ser)});
return ThreadState.CONNECTED;
}
catch (Throwable e) { // Covers IOException as well
- log.info("Problems while handing data over to gateway " + endpoint + ": " + Exceptions.toMessageString(e));
+ log.log(Level.INFO, "Problems while handing data over to gateway {0}: {1}", new Object[] {endpoint, Exceptions.toMessageString(e)});
client.close();
return ThreadState.DISCONNECTED;
}
