public void messageSent(NextFilter nextFilter, IoSession session,
WriteRequest request) throws Exception {
Object message = request.getMessage();
if (message instanceof StanzaWriteInfo) {
StanzaWriteInfo stanzaWriteInfo = (StanzaWriteInfo) message;
if (serverLogger.isInfoEnabled()) {
serverLogger.info(DenseStanzaLogRenderer.render(stanzaWriteInfo
.getStanza()));
}
if (serverLogger.isDebugEnabled()) {
String xml = toXml(stanzaWriteInfo.getStanza(), stanzaWriteInfo
.isWriteOpeningElement(), stanzaWriteInfo
.isWriteClosingElement());
serverLogger.info("Sent stanza: " + xml);
}
}