Logging: Stop logging closed channel exceptions by default

Original commit: elastic/x-pack-elasticsearch@c563ecaafb
This commit is contained in:
Alexander Reelsen 2014-10-01 17:26:48 +02:00
parent 11ff005dc3
commit 994f785715
1 changed files with 6 additions and 3 deletions

View File

@ -30,12 +30,15 @@ public class SecuredMessageChannelHandler extends MessageChannelHandler {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (future.isSuccess()) {
logger.debug("SSL / TLS handshake completed for channel", ctx.getName());
logger.debug("SSL / TLS handshake completed for channel");
ctx.sendUpstream(e);
} else {
logger.error("SSL / TLS handshake failed, closing channel", ctx.getName());
if (logger.isDebugEnabled()) {
logger.error("SSL / TLS handshake failed, closing channel: {}", future.getCause(), future.getCause().getMessage());
} else {
logger.error("SSL / TLS handshake failed, closing channel: {}", future.getCause().getMessage());
}
future.getChannel().close();
throw new ElasticsearchSSLException("SSL / TLS handshake failed, closing the channel", future.getCause());
}
}
});