Skip to content

Commit 4d2ab70

Browse files
committed
Improve logging
1 parent e8da7bc commit 4d2ab70

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public NettyAsyncHttpProvider(AsyncHttpClientConfig config) {
196196
e = Executors.newCachedThreadPool();
197197
}
198198
int numWorkers = config.getIoThreadMultiplier() * Runtime.getRuntime().availableProcessors();
199-
log.info("Number of application's worked threads is {}", numWorkers);
199+
log.debug("Number of application's worked threads is {}", numWorkers);
200200
socketChannelFactory = new NioClientSocketChannelFactory(e, config.executorService(), numWorkers);
201201
}
202202
plainBootstrap = new ClientBootstrap(socketChannelFactory);

src/main/java/com/ning/http/client/providers/netty/NettyConnectListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public final void operationComplete(ChannelFuture f) throws Exception {
9292

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

95-
ConnectException e = new ConnectException(f.getCause() != null ? cause.getMessage() + " to " + future.getURI().toString(): future.getURI().toString());
95+
boolean printCause = f.getCause() != null && cause.getMessage() != null;
96+
ConnectException e = new ConnectException( printCause ? cause.getMessage() + " to " + future.getURI().toString() : future.getURI().toString());
9697
if (cause != null) {
9798
e.initCause(cause);
9899
}

0 commit comments

Comments
 (0)