Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve logging
  • Loading branch information
jfarcand committed Jun 15, 2011
1 parent e8da7bc commit 4d2ab70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -196,7 +196,7 @@ public NettyAsyncHttpProvider(AsyncHttpClientConfig config) {
e = Executors.newCachedThreadPool();
}
int numWorkers = config.getIoThreadMultiplier() * Runtime.getRuntime().availableProcessors();
log.info("Number of application's worked threads is {}", numWorkers);
log.debug("Number of application's worked threads is {}", numWorkers);
socketChannelFactory = new NioClientSocketChannelFactory(e, config.executorService(), numWorkers);
}
plainBootstrap = new ClientBootstrap(socketChannelFactory);
Expand Down
Expand Up @@ -92,7 +92,8 @@ public final void operationComplete(ChannelFuture f) throws Exception {

logger.debug("Failed to recover from exception: {} with channel {}", cause, f.getChannel());

ConnectException e = new ConnectException(f.getCause() != null ? cause.getMessage() + " to " + future.getURI().toString(): future.getURI().toString());
boolean printCause = f.getCause() != null && cause.getMessage() != null;
ConnectException e = new ConnectException( printCause ? cause.getMessage() + " to " + future.getURI().toString() : future.getURI().toString());
if (cause != null) {
e.initCause(cause);
}
Expand Down

0 comments on commit 4d2ab70

Please sign in to comment.