More WebSocket logging updates
Update WebSocketSession toString methods to include the handshake URI and add id and URI fields to ensure they're available after close(). Log WebSocket session open and close events at INFO. Remove trace messages for destinations that do not match. Issue: SPR-11884
This commit is contained in:
@@ -135,9 +135,6 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
|
||||
String sessionId = SimpMessageHeaderAccessor.getSessionId(headers);
|
||||
|
||||
if (!checkDestinationPrefix(destination)) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("No match on destination in " + message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -173,11 +170,6 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
|
||||
}
|
||||
this.subscriptionRegistry.unregisterSubscription(message);
|
||||
}
|
||||
else {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Unsupported message type in " + message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initHeaders(SimpMessageHeaderAccessor accessor) {
|
||||
|
||||
@@ -454,9 +454,6 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
||||
|
||||
String destination = stompAccessor.getDestination();
|
||||
if ((command != null) && command.requiresDestination() && !checkDestinationPrefix(destination)) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("No match on destination. Ignoring " + message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,8 +171,8 @@ public class UserDestinationMessageHandler implements MessageHandler, SmartLifec
|
||||
}
|
||||
Set<String> destinations = result.getTargetDestinations();
|
||||
if (destinations.isEmpty()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Use destination not resolved (no active sessions?): " + message);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("No user destinations for " + message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public class UserDestinationMessageHandler implements MessageHandler, SmartLifec
|
||||
}
|
||||
for (String destination : destinations) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Sending message with resolved user destination: " + message);
|
||||
logger.trace("Sending " + message);
|
||||
}
|
||||
this.brokerMessagingTemplate.send(destination, message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user