From 665fd209952e45390e505aef1458620ebb1c5cbc Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 11 Jun 2015 12:12:09 -0700 Subject: [PATCH] 469991 - Fix logging levels in websocket client UpgradeConnection + Cleanup of logging levels --- .../client/io/UpgradeConnection.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java index 8078a22f581..0f0f8373dbc 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/UpgradeConnection.java @@ -60,6 +60,8 @@ public class UpgradeConnection extends AbstractConnection implements Connection. { public class SendUpgradeRequest extends FutureCallback implements Runnable { + private final Logger LOG = Log.getLogger(UpgradeConnection.SendUpgradeRequest.class); + @Override public void run() { @@ -81,7 +83,10 @@ public class UpgradeConnection extends AbstractConnection implements Connection. @Override public void succeeded() { - LOG.debug("Upgrade Request Write Success"); + if (LOG.isDebugEnabled()) + { + LOG.debug("Upgrade Request Write Success"); + } // Writing the request header is complete. super.succeeded(); state = State.RESPONSE; @@ -92,7 +97,10 @@ public class UpgradeConnection extends AbstractConnection implements Connection. @Override public void failed(Throwable cause) { - LOG.warn("Upgrade Request Write Failure",cause); + if (LOG.isDebugEnabled()) + { + LOG.debug("Upgrade Request Write Failure",cause); + } super.failed(cause); state = State.FAILURE; // Fail the connect promise when a fundamental exception during connect occurs. @@ -136,12 +144,17 @@ public class UpgradeConnection extends AbstractConnection implements Connection. // We need to gently close first, to allow // SSL close alerts to be sent by Jetty if (LOG.isDebugEnabled()) + { LOG.debug("Shutting down output {}",endPoint); + } + endPoint.shutdownOutput(); if (!onlyOutput) { if (LOG.isDebugEnabled()) + { LOG.debug("Closing {}",endPoint); + } endPoint.close(); } } @@ -211,7 +224,7 @@ public class UpgradeConnection extends AbstractConnection implements Connection. { if (LOG.isDebugEnabled()) { - LOG.warn("Closed connection {}",this); + LOG.debug("Closed connection {}",this); } super.onClose(); } @@ -221,7 +234,7 @@ public class UpgradeConnection extends AbstractConnection implements Connection. { if (LOG.isDebugEnabled()) { - LOG.warn("Timeout on connection {}",this); + LOG.debug("Timeout on connection {}",this); } failUpgrade(new IOException("Timeout while performing WebSocket Upgrade"));