NIFI-8083: SSLSocketChannel Logging Improvement

Fixed additional logs messages with same issue

Signed-off-by: Matthew Burgess <mattyb149@apache.org>

This closes #4722
This commit is contained in:
David Mollitor 2020-12-10 16:40:04 -05:00 committed by Matthew Burgess
parent 7bff64b3cf
commit 8eb0db6b38
No known key found for this signature in database
GPG Key ID: 05D3DEB8126DAD24
1 changed files with 3 additions and 12 deletions

View File

@ -170,10 +170,7 @@ public class SSLSocketChannel implements Closeable {
connected = true;
} catch (final Exception e) {
logger.error("{} Failed to connect due to {}", this, e);
if (logger.isDebugEnabled()) {
logger.error("", e);
}
logger.error("{} failed to connect", this, e);
closeQuietly(channel);
engine.closeInbound();
engine.closeOutbound();
@ -397,10 +394,7 @@ public class SSLSocketChannel implements Closeable {
try {
readCount = channel.read(writableInBuffer);
} catch (IOException e) {
logger.error("{} Failed to readData due to {}", new Object[]{this, e});
if (logger.isDebugEnabled()) {
logger.error("", e);
}
logger.error("{} failed to read data", this, e);
readCount = -1; // treat the condition same as if End of Stream
}
if (readCount == 0) {
@ -428,10 +422,7 @@ public class SSLSocketChannel implements Closeable {
return false;
}
} catch (IOException e) {
logger.error("{} Failed to check if closed due to {}. Closing channel.", new Object[]{this, e});
if (logger.isDebugEnabled()) {
logger.error("", e);
}
logger.error("{} failed to check if closed. Closing channel.", this, e);
}
}
// either readCount is -1, indicating an end of stream, or the peer sent a closure handshake