Author: markt
Date: Thu Mar 17 19:36:08 2016
New Revision: 1735481

URL: http://svn.apache.org/viewvc?rev=1735481&view=rev
Log:
Improve debug logging for WebSocket

Modified:
    tomcat/tc8.5.x/trunk/   (props changed)
    
tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
    tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/WsSession.java

Propchange: tomcat/tc8.5.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 17 19:36:08 2016
@@ -1 +1 @@
-/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044
+/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480

Modified: 
tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1735481&r1=1735480&r2=1735481&view=diff
==============================================================================
--- 
tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties 
(original)
+++ 
tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties 
Thu Mar 17 19:36:08 2016
@@ -91,7 +91,7 @@ wsRemoteEndpoint.wrongState=The remote e
 # frame and therefore must be 123 bytes (not characters) or less in length.
 # Messages are encoded using UTF-8 where a single character may be encoded in
 # as many as 4 bytes.
-wsSession.timeout=The WebSocket session timeout expired
+wsSession.timeout=The WebSocket session [{0}] timeout expired
 
 wsSession.closed=The WebSocket session [{0}] has been closed and no method 
(apart from close()) may be called on a closed session
 wsSession.created=Created WebSocket session [{0}]

Modified: tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/WsSession.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1735481&r1=1735480&r2=1735481&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/WsSession.java 
(original)
+++ tomcat/tc8.5.x/trunk/java/org/apache/tomcat/websocket/WsSession.java Thu 
Mar 17 19:36:08 2016
@@ -772,7 +772,10 @@ public class WsSession implements Sessio
         }
 
         if (System.currentTimeMillis() - lastActive > timeout) {
-            String msg = sm.getString("wsSession.timeout");
+            String msg = sm.getString("wsSession.timeout", getId());
+            if (log.isDebugEnabled()) {
+                log.debug(msg);
+            }
             doClose(new CloseReason(CloseCodes.GOING_AWAY, msg),
                     new CloseReason(CloseCodes.CLOSED_ABNORMALLY, msg));
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to