Improved logging.
This commit is contained in:
parent
bad3165d8a
commit
7b7c592fc8
|
@ -236,6 +236,11 @@ public class ConnectionPool implements Closeable, Dumpable
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s %d/%d", getClass().getSimpleName(), connectionCount.get(), maxConnections);
|
||||
return String.format("%s[c=%d/%d,a=%d,i=%d]",
|
||||
getClass().getSimpleName(),
|
||||
connectionCount.get(),
|
||||
maxConnections,
|
||||
activeConnections.size(),
|
||||
idleConnections.size());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ public abstract class HttpDestination implements Destination, Closeable, Dumpabl
|
|||
else
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Queued {}", request);
|
||||
LOG.debug("Queued {} for {}", request, this);
|
||||
requestNotifier.notifyQueued(request);
|
||||
send();
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public abstract class HttpDestination implements Destination, Closeable, Dumpabl
|
|||
else
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Max queue size {} exceeded by {}", client.getMaxRequestsQueuedPerDestination(), request);
|
||||
LOG.debug("Max queue size {} exceeded by {} for {}", client.getMaxRequestsQueuedPerDestination(), request, this);
|
||||
request.abort(new RejectedExecutionException("Max requests per destination " + client.getMaxRequestsQueuedPerDestination() + " exceeded for " + this));
|
||||
}
|
||||
}
|
||||
|
@ -258,9 +258,10 @@ public abstract class HttpDestination implements Destination, Closeable, Dumpabl
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s(%s)%s",
|
||||
return String.format("%s[%s]%s,queue=%d",
|
||||
HttpDestination.class.getSimpleName(),
|
||||
asString(),
|
||||
proxy == null ? "" : " via " + proxy);
|
||||
proxy == null ? "" : "(via " + proxy + ")",
|
||||
exchanges.size());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public abstract class PoolingHttpDestination<C extends Connection> extends HttpD
|
|||
HttpClient client = getHttpClient();
|
||||
final HttpExchange exchange = getHttpExchanges().poll();
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Processing exchange {} on connection {}", exchange, connection);
|
||||
LOG.debug("Processing exchange {} on {} of {}", exchange, connection, this);
|
||||
if (exchange == null)
|
||||
{
|
||||
if (!connectionPool.release(connection))
|
||||
|
@ -213,4 +213,10 @@ public abstract class PoolingHttpDestination<C extends Connection> extends HttpD
|
|||
{
|
||||
ContainerLifeCycle.dump(out, indent, Arrays.asList(connectionPool));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s,pool=%s", super.toString(), connectionPool);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue