tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1735480 - in /tomcat/trunk/java/org/apache/tomcat/websocket: LocalStrings.properties WsSession.java
Date Thu, 17 Mar 2016 19:35:19 GMT
Author: markt
Date: Thu Mar 17 19:35:19 2016
New Revision: 1735480

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

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
    tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties?rev=1735480&r1=1735479&r2=1735480&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/LocalStrings.properties Thu Mar 17 19:35:19
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/trunk/java/org/apache/tomcat/websocket/WsSession.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java?rev=1735480&r1=1735479&r2=1735480&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsSession.java Thu Mar 17 19:35:19 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message