Refine logging in StompErrorHandler
Avoid a full stacktrace at ERROR level for a client message that could not be sent to a MessageChannel. See gh-26026
This commit is contained in:
parent
21f9d05bd9
commit
17dd7785f6
|
|
@ -328,8 +328,13 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
|
|||
}
|
||||
catch (Throwable ex) {
|
||||
if (logger.isErrorEnabled()) {
|
||||
logger.error("Failed to send client message to application via MessageChannel" +
|
||||
" in session " + session.getId() + ". Sending STOMP ERROR to client.", ex);
|
||||
String errorText = "Failed to send message to MessageChannel in session " + session.getId();
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(errorText, ex);
|
||||
}
|
||||
else {
|
||||
logger.error(errorText + ":" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
handleError(session, ex, message);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue