@@ -276,7 +276,7 @@ private Channel lookupInCache(URI uri) {
276276final Channel channel =connectionsPool .poll (AsyncHttpProviderUtils .getBaseUrl (uri ));
277277
278278if (channel !=null ) {
279- log .debug ("Using cached Channel {} for uri {}" ,channel ,uri );
279+ log .debug ("Using cached Channel {}\n for uri {}\n " ,channel ,uri );
280280
281281try {
282282// Always make sure the channel who got cached support the proper protocol. It could
@@ -748,7 +748,7 @@ private <T> Future<T> doConnect(final Request request, final AsyncHandler<T> asy
748748f .setState (NettyResponseFuture .STATE .POOLED );
749749f .attachChannel (channel ,false );
750750
751- log .debug ("\n \n Cached Request {}\n " ,channel );
751+ log .debug ("\n Using cached Channel {} \n for request {}\n " ,channel , request );
752752channel .getPipeline ().getContext (NettyAsyncHttpProvider .class ).setAttachment (f );
753753
754754try {
@@ -765,8 +765,6 @@ private <T> Future<T> doConnect(final Request request, final AsyncHandler<T> asy
765765return f ;
766766 }
767767
768- log .debug ("\n \n Non cached Request {}\n " ,request );
769-
770768if (!connectionsPool .canCacheConnection () ||
771769 (config .getMaxTotalConnections () > -1 && (maxConnections .get () +1 ) >config .getMaxTotalConnections ())) {
772770throw new IOException (String .format ("Too many connections %s" ,config .getMaxTotalConnections ()));
@@ -825,6 +823,8 @@ private <T> Future<T> doConnect(final Request request, final AsyncHandler<T> asy
825823channelFuture .addListener (c );
826824 }
827825
826+ log .debug ("\n \n Non cached Request {}\n with channel {}\n " ,request ,channel );
827+
828828if (!c .future ().isCancelled () || !c .future ().isDone ()) {
829829openChannels .add (channelFuture .getChannel ());
830830c .future ().attachChannel (channelFuture .getChannel (),false );
@@ -1293,7 +1293,7 @@ public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws
12931293exception =ex ;
12941294 }
12951295
1296- log .debug ("Channel Closed: {}" ,e .getChannel ());
1296+ log .debug ("Channel Closed: {} with attachment {} " ,e .getChannel (), ctx . getAttachment ());
12971297
12981298if (ctx .getAttachment ()instanceof AsyncCallable ) {
12991299AsyncCallable ac = (AsyncCallable )ctx .getAttachment ();
@@ -1342,21 +1342,21 @@ protected boolean remotelyClosed(Channel channel, NettyResponseFuture<?> future)
13421342 }
13431343
13441344if (future ==null ||future .cannotBeReplay ()) {
1345- log .debug ("Unable to replay request {} associated with future" ,future ==null ?"" :future .getNettyRequest (),future );
1345+ log .debug ("Unable to replay request {}\n associated with future {} \n " ,future ==null ?"null " :future .getNettyRequest (),future );
13461346return false ;
13471347 }
13481348
13491349future .setState (NettyResponseFuture .STATE .RECONNECTED );
13501350
1351- log .debug ("Trying to recover request {}" ,future .getNettyRequest ());
1351+ log .debug ("Trying to recover request {}\n " ,future .getNettyRequest ());
13521352
13531353try {
13541354nextRequest (future .getRequest (),future );
13551355return true ;
13561356 }catch (IOException iox ) {
13571357future .setState (NettyResponseFuture .STATE .CLOSED );
13581358future .abort (iox );
1359- log .error ("Remotely Closed" ,iox );
1359+ log .error ("Remotely Closed, unable to recover " ,iox );
13601360 }
13611361return false ;
13621362 }
@@ -1453,7 +1453,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
14531453 }
14541454
14551455if (abortOnReadCloseException (cause ) ||abortOnWriteCloseException (cause )) {
1456- log .debug ("Trying to recover from dead Channel: {}" ,channel );
1456+ log .debug ("Trying to recover from dead Channel: {}\n request {} " ,channel , future . getNettyRequest () );
14571457if (remotelyClosed (channel ,future )) {
14581458return ;
14591459 }
@@ -1724,7 +1724,7 @@ public synchronized void run() {
17241724 }
17251725
17261726if (this .nettyResponseFuture !=null &&this .nettyResponseFuture .hasExpired ()) {
1727- log .debug ("Request Timeout expired for {}" ,this .nettyResponseFuture );
1727+ log .debug ("Request Timeout expired for {}\n " ,this .nettyResponseFuture );
17281728
17291729int requestTimeout =config .getRequestTimeoutInMs ();
17301730PerRequestConfig p =this .nettyResponseFuture .getRequest ().getPerRequestConfig ();