Make log shorter on IOException. This is not an ordinary exception. Info level. Others will be fired under error log level
This commit is contained in:
parent
ed6324e7eb
commit
d0237c4536
@ -883,7 +883,16 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||||
log.error("[{}] Unexpected Exception", sessionId, cause);
|
if (cause instanceof IOException) {
|
||||||
|
if (log.isInfoEnabled()) {
|
||||||
|
log.info("[{}][{}] IOException: {}", sessionId,
|
||||||
|
Optional.ofNullable(this.deviceSessionCtx.getDeviceInfo()).map(TransportDeviceInfo::getDeviceName).orElse(""),
|
||||||
|
cause.getMessage());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.error("[{}] Unexpected Exception", sessionId, cause);
|
||||||
|
}
|
||||||
|
|
||||||
ctx.close();
|
ctx.close();
|
||||||
if (cause instanceof OutOfMemoryError) {
|
if (cause instanceof OutOfMemoryError) {
|
||||||
log.error("Received critical error. Going to shutdown the service.");
|
log.error("Received critical error. Going to shutdown the service.");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user