From 994f7857159c2613d3209eed1a9ffa7098c4ab7b Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Wed, 1 Oct 2014 17:26:48 +0200 Subject: [PATCH] Logging: Stop logging closed channel exceptions by default Original commit: elastic/x-pack-elasticsearch@c563ecaafbc31382e02ef07e782368ad25bc5b3b --- .../transport/netty/SecuredMessageChannelHandler.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/SecuredMessageChannelHandler.java b/src/main/java/org/elasticsearch/shield/transport/netty/SecuredMessageChannelHandler.java index 01f9d226fac..9c6de35015e 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/SecuredMessageChannelHandler.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/SecuredMessageChannelHandler.java @@ -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()); } } });