diff --git a/src/main/java/org/edgegallery/website/sessionmgr/WebSocketSessionServer.java b/src/main/java/org/edgegallery/website/sessionmgr/WebSocketSessionServer.java index 7962d1a14b9ed8b25c43a2c24dfd1266d9321232..3b95e4b157505791a6196ee3525b2996543dfef2 100644 --- a/src/main/java/org/edgegallery/website/sessionmgr/WebSocketSessionServer.java +++ b/src/main/java/org/edgegallery/website/sessionmgr/WebSocketSessionServer.java @@ -59,7 +59,8 @@ public class WebSocketSessionServer { LOGGER.warn("invalid http session id."); return; } - + LOGGER.info("websocket wsSession: {}", wsSession); + LOGGER.info("websocket httpSessionId: {}", httpSessionId); LOGGER.debug("ws client opened."); synchronized (LOCK_OBJ) { List wsSessList = WS_SESSION_FINDER.get(httpSessionId); @@ -81,11 +82,16 @@ public class WebSocketSessionServer { */ @OnMessage public void onMessage(String message, Session wsSession) { - LOGGER.debug("receive message from ws client"); + LOGGER.info("receive message from ws client, {}", wsSession); synchronized (LOCK_OBJ) { String httpSessId = HTTP_SESSIONID_FINDER.get(wsSession.getId()); HttpSession httpSession = CustomHttpSessionManager.getInstance().getSession(httpSessId); + LOGGER.info("httpSession info is: {}", httpSession); if (httpSession != null) { + LOGGER.info("httpSession info the start time is: {}", + (System.currentTimeMillis() - httpSession.getLastAccessedTime()) / 1000); + LOGGER.info("httpSession info the end time is: {}", + Consts.HTTP_SESSION_TIMEOUT - Consts.ADV_NOTIFY_TIME_FOR_HTTP_SESSION_TIMEOUT); if ((System.currentTimeMillis() - httpSession.getLastAccessedTime()) / 1000 > Consts.HTTP_SESSION_TIMEOUT - Consts.ADV_NOTIFY_TIME_FOR_HTTP_SESSION_TIMEOUT) { notifyHttpSessionInvalid(httpSessId, Consts.HttpSessionInvalidScene.TIMEOUT);