update 打印日志

This commit is contained in:
2023-09-12 09:22:07 +08:00
parent 403a407f0f
commit c994fa6eff

View File

@@ -189,7 +189,9 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
ChannelId channelId = ctx.channel().id();
log.error("发生异常 channelId:{}", channelId.asShortText(), cause);
String channelIdShortText = channelId.asShortText();
String pileSn = PileChannelEntity.getPileSnByChannelId(channelIdShortText);
log.error("发生异常 channelId:{}, pileSn:{}", channelIdShortText, pileSn, cause);
cause.printStackTrace();
// 如果桩连到平台在1分钟内没有发送数据过来会报ReadTimeoutException异常
if (cause instanceof ReadTimeoutException) {