level="TRACE" additivity="false">
<AppenderRef ref="STDOUT" />
</Logger>
+
+
+ <!--
+ Separate logger to use on network IO failure after a client has gone away.
+ See: DISCONNECTED_CLIENT_LOG_CATEGORY in org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession
+ -->
+ <Logger
+ name="org.springframework.web.socket.sockjs.DisconnectedClient"
+ level="TRACE" additivity="false">
+ <AppenderRef ref="STDOUT" />
+ </Logger>
<!--
General logging Spring.
public Message<?> preSend(Message<?> message, MessageChannel channel) {
StompHeaderAccessor accessor = StompHeaderAccessor.wrap(message);
StompCommand command = accessor.getCommand();
-
+
LOGGER.info("CustomChannelInterceptor preSend, StompCommand: " + command);
LOGGER.info("CustomChannelInterceptor preSend, login: " + accessor.getLogin());
- LOGGER.info("CustomChannelInterceptor preSend, heartBeat: " + accessor.getHeartbeat());
+
+ long[] heartBeats = accessor.getHeartbeat();
+ for (long heartBeat : heartBeats) {
+ LOGGER.info("CustomChannelInterceptor preSend, heartBeat: " + heartBeat);
+ }
+
LOGGER.info("CustomChannelInterceptor preSend, destination: " + accessor.getDestination());
LOGGER.info("CustomChannelInterceptor preSend, host: " + accessor.getHost());
+ LOGGER.info("CustomChannelInterceptor preSend, message: " + accessor.getMessage());
+ LOGGER.info("CustomChannelInterceptor preSend, sessionId: " + accessor.getSessionId());
+
+
+ byte[] payload = (byte[])message.getPayload();
+ String stringPayload = new String(payload);
+ LOGGER.info("CustomChannelInterceptor preSend, payload: " + stringPayload);
return message;
}
LOGGER.info("CustomChannelInterceptor postSend, StompCommand: " + command);
LOGGER.info("CustomChannelInterceptor postSend, login: " + accessor.getLogin());
- LOGGER.info("CustomChannelInterceptor postSend, heartBeat: " + accessor.getHeartbeat());
+
+ long[] heartBeats = accessor.getHeartbeat();
+ for (long heartBeat : heartBeats) {
+ LOGGER.info("CustomChannelInterceptor postSend, heartBeat: " + heartBeat);
+ }
+
LOGGER.info("CustomChannelInterceptor postSend, destination: " + accessor.getDestination());
LOGGER.info("CustomChannelInterceptor postSend, host: " + accessor.getHost());
+ LOGGER.info("CustomChannelInterceptor postSend, message: " + accessor.getMessage());
+ LOGGER.info("CustomChannelInterceptor postSend, sessionId: " + accessor.getSessionId());
+
+ byte[] payload = (byte[])message.getPayload();
+ String stringPayload = new String(payload);
+ LOGGER.info("CustomChannelInterceptor preSend, payload: " + stringPayload);
}
+
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
+import org.springframework.messaging.simp.stomp.StompCommand;
+import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
import org.springframework.web.socket.messaging.SessionConnectEvent;
public class SessionConnectListener implements ApplicationListener<SessionConnectEvent> {
private static final Logger LOGGER = LoggerFactory.getLogger(SessionConnectListener.class);
@Override
- public void onApplicationEvent(SessionConnectEvent event) {
+ public void onApplicationEvent(SessionConnectEvent event) {
LOGGER.info("SessionConnectEvent timestamp: " + event.getTimestamp());
LOGGER.info("SessionConnectEvent user: " + event.getUser());
LOGGER.info("SessionConnectEvent: " + event.toString());
+
+ StompHeaderAccessor accessor = StompHeaderAccessor.wrap(event.getMessage());
+ StompCommand command = accessor.getCommand();
+
+ LOGGER.info("SessionConnectEvent, StompCommand: " + command);
+ LOGGER.info("SessionConnectEvent, login: " + accessor.getLogin());
+
+ long[] heartBeats = accessor.getHeartbeat();
+ for (long heartBeat : heartBeats) {
+ LOGGER.info("SessionConnectEvent, heartBeat: " + heartBeat);
+ }
+
+ LOGGER.info("SessionConnectEvent, destination: " + accessor.getDestination());
+ LOGGER.info("SessionConnectEvent, host: " + accessor.getHost());
+ LOGGER.info("SessionConnectEvent, message: " + accessor.getMessage());
+ LOGGER.info("SessionConnectEvent, sessionId: " + accessor.getSessionId());
+ LOGGER.info("SessionConnectEvent, subscriptionId: " + accessor.getSubscriptionId());
+
+ byte[] payload = (byte[])event.getMessage().getPayload();
+ String stringPayload = new String(payload);
+ LOGGER.info("SessionConnectEvent, payload: " + stringPayload);
}
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
+import org.springframework.messaging.simp.stomp.StompCommand;
+import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
import org.springframework.web.socket.messaging.SessionConnectedEvent;
public class SessionConnectedListener implements ApplicationListener<SessionConnectedEvent> {
LOGGER.info("SessionConnectedEvent timestamp: " + event.getTimestamp());
LOGGER.info("SessionConnectedEvent user: " + event.getUser());
LOGGER.info("SessionConnectedEvent: " + event.toString());
+
+ StompHeaderAccessor accessor = StompHeaderAccessor.wrap(event.getMessage());
+ StompCommand command = accessor.getCommand();
+
+ LOGGER.info("SessionConnectedEvent, StompCommand: " + command);
+ LOGGER.info("SessionConnectedEvent, login: " + accessor.getLogin());
+
+ long[] heartBeats = accessor.getHeartbeat();
+ for (long heartBeat : heartBeats) {
+ LOGGER.info("SessionConnectedEvent, heartBeat: " + heartBeat);
+ }
+
+ LOGGER.info("SessionConnectedEvent, destination: " + accessor.getDestination());
+ LOGGER.info("SessionConnectedEvent, host: " + accessor.getHost());
+ LOGGER.info("SessionConnectedEvent, message: " + accessor.getMessage());
+ LOGGER.info("SessionConnectedEvent, sessionId: " + accessor.getSessionId());
+ LOGGER.info("SessionConnectedEvent, subscriptionId: " + accessor.getSubscriptionId());
+
+
+ byte[] payload = (byte[])event.getMessage().getPayload();
+ String stringPayload = new String(payload);
+ LOGGER.info("SessionConnectedEvent, payload: " + stringPayload);
}
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
+import org.springframework.messaging.simp.stomp.StompCommand;
+import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
import org.springframework.web.socket.messaging.SessionDisconnectEvent;
public class SessionDisconnectListener implements ApplicationListener<SessionDisconnectEvent> {
LOGGER.info("SessionDisconnectEvent sessionId: " + event.getSessionId());
LOGGER.info("SessionDisconnectEvent close status: " + event.getCloseStatus());
LOGGER.info("SessionDisconnectEvent: " + event.toString());
+
+ StompHeaderAccessor accessor = StompHeaderAccessor.wrap(event.getMessage());
+ StompCommand command = accessor.getCommand();
+
+ LOGGER.info("SessionDisconnectEvent, StompCommand: " + command);
+ LOGGER.info("SessionDisconnectEvent, login: " + accessor.getLogin());
+
+ long[] heartBeats = accessor.getHeartbeat();
+ for (long heartBeat : heartBeats) {
+ LOGGER.info("SessionDisconnectEvent, heartBeat: " + heartBeat);
+ }
+
+ LOGGER.info("SessionDisconnectEvent, destination: " + accessor.getDestination());
+ LOGGER.info("SessionDisconnectEvent, host: " + accessor.getHost());
+ LOGGER.info("SessionDisconnectEvent, message: " + accessor.getMessage());
+ LOGGER.info("SessionDisconnectEvent, sessionId: " + accessor.getSessionId());
+ LOGGER.info("SessionDisconnectEvent, subscriptionId: " + accessor.getSubscriptionId());
+
+ byte[] payload = (byte[])event.getMessage().getPayload();
+ String stringPayload = new String(payload);
+ LOGGER.info("SessionDisconnectEvent, payload: " + stringPayload);
}
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
+import org.springframework.messaging.simp.stomp.StompCommand;
+import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
import org.springframework.web.socket.messaging.SessionSubscribeEvent;
public class SessionSubscribeListener implements ApplicationListener<SessionSubscribeEvent> {
LOGGER.info("SessionSubscribeEvent timestamp: " + event.getTimestamp());
LOGGER.info("SessionSubscribeEvent user: " + event.getUser());
LOGGER.info("SessionSubscribeEvent: " + event.toString());
+
+ StompHeaderAccessor accessor = StompHeaderAccessor.wrap(event.getMessage());
+ StompCommand command = accessor.getCommand();
+
+ LOGGER.info("SessionSubscribeEvent, StompCommand: " + command);
+ LOGGER.info("SessionSubscribeEvent, login: " + accessor.getLogin());
+
+ long[] heartBeats = accessor.getHeartbeat();
+ for (long heartBeat : heartBeats) {
+ LOGGER.info("CustomChannelInterceptor preSend, heartBeat: " + heartBeat);
+ }
+
+ LOGGER.info("SessionSubscribeEvent, destination: " + accessor.getDestination());
+ LOGGER.info("SessionSubscribeEvent, host: " + accessor.getHost());
+ LOGGER.info("SessionSubscribeEvent, message: " + accessor.getMessage());
+ LOGGER.info("SessionSubscribeEvent, sessionId: " + accessor.getSessionId());
+ LOGGER.info("SessionSubscribeEvent, subscriptionId: " + accessor.getSubscriptionId());
+
+ byte[] payload = (byte[])event.getMessage().getPayload();
+ String stringPayload = new String(payload);
+ LOGGER.info("SessionSubscribeEvent, payload: " + stringPayload);
}
}
level="TRACE" additivity="false">
<AppenderRef ref="STDOUT" />
</Logger>
+
+
+ <!--
+ Separate logger to use on network IO failure after a client has gone away.
+ See: DISCONNECTED_CLIENT_LOG_CATEGORY in org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession
+ -->
+ <Logger
+ name="org.springframework.web.socket.sockjs.DisconnectedClient"
+ level="TRACE" additivity="false">
+ <AppenderRef ref="STDOUT" />
+ </Logger>
<!--
General logging Spring.