From 9f9d0223731a1ad89ee812de445da4d1887bad6e Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Wed, 31 Mar 2021 12:20:02 +0200 Subject: [PATCH] improve debug logs Signed-off-by: Ludovic Orban --- .../jetty/http3/common/QuicStreamEndPoint.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/common/QuicStreamEndPoint.java b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/common/QuicStreamEndPoint.java index 4babf0c61aa..58089a5c651 100644 --- a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/common/QuicStreamEndPoint.java +++ b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/common/QuicStreamEndPoint.java @@ -54,12 +54,14 @@ public class QuicStreamEndPoint extends AbstractEndPoint { try { + if (LOG.isDebugEnabled()) + LOG.debug("shutting down input of stream {}", streamId); session.shutdownInput(streamId); } catch (IOException x) { if (LOG.isDebugEnabled()) - LOG.debug("error shutting down output", x); + LOG.debug("error shutting down output of stream {}", streamId, x); } } @@ -68,18 +70,22 @@ public class QuicStreamEndPoint extends AbstractEndPoint { try { + if (LOG.isDebugEnabled()) + LOG.debug("shutting down output of stream {}", streamId); session.shutdownOutput(streamId); } catch (IOException x) { if (LOG.isDebugEnabled()) - LOG.debug("error shutting down output", x); + LOG.debug("error shutting down output of stream {}", streamId, x); } } @Override public void onClose(Throwable failure) { + if (LOG.isDebugEnabled()) + LOG.debug("closing stream {}", streamId); try { session.flushFinished(streamId); @@ -96,6 +102,8 @@ public class QuicStreamEndPoint extends AbstractEndPoint @Override public int fill(ByteBuffer buffer) throws IOException { + if (LOG.isDebugEnabled()) + LOG.debug("filling buffer from stream {}", streamId); int pos = BufferUtil.flipToFill(buffer); int drained = session.fill(streamId, buffer); BufferUtil.flipToFlush(buffer, pos); @@ -108,7 +116,7 @@ public class QuicStreamEndPoint extends AbstractEndPoint public boolean flush(ByteBuffer... buffers) throws IOException { if (LOG.isDebugEnabled()) - LOG.debug("flushing {} buffer(s) stream {}", buffers.length, streamId); + LOG.debug("flushing {} buffer(s) to stream {}", buffers.length, streamId); for (ByteBuffer buffer : buffers) { int flushed = session.flush(streamId, buffer); @@ -122,7 +130,7 @@ public class QuicStreamEndPoint extends AbstractEndPoint } } if (LOG.isDebugEnabled()) - LOG.debug("fully flushed stream {}", streamId); + LOG.debug("flushed stream {}", streamId); return true; }