Skip to content

Commit f784a28

Browse files
committed
Chore: Log Channel ID when socket-like exception thrown
Signed-off-by: RichardLea <chigix@zoho.com>
1 parent 1018f4c commit f784a28

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/chigix/resserver/Application.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
123123
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
124124
if (cause instanceof IOException) {
125125
if (ctx.channel().isOpen()) {
126-
LOG.warn(cause.getMessage() + ", Channel is not closed.");
126+
LOG.warn(cause.getMessage()
127+
+ ", Channel[" + ctx.channel().id() + "] "
128+
+ "is not closed.");
127129
}
128130
ctx.close();
129131
return;

0 commit comments

Comments
 (0)