diff --git a/common/src/main/java/com/oceanbase/oms/logmessage/LogMessage.java b/common/src/main/java/com/oceanbase/oms/logmessage/LogMessage.java index 4c209d34d2b9bb42ca9a6164d7e934dbdb7cad5b..ee0f3653ed2cfa412cd07ef3b2b44a366bd41a00 100644 --- a/common/src/main/java/com/oceanbase/oms/logmessage/LogMessage.java +++ b/common/src/main/java/com/oceanbase/oms/logmessage/LogMessage.java @@ -941,7 +941,7 @@ public class LogMessage extends DataMessage.Record { } int j = keyStr.indexOf(')', i); if (j == -1) { - log.error("parse key error"); + log.error("Parse key error"); return null; } m = j; @@ -1077,7 +1077,7 @@ public class LogMessage extends DataMessage.Record { } return primaryValues; } catch (Exception e) { - throw new RuntimeException(e); + throw new LogMessageException(e.getMessage(), e.getCause()); } } diff --git a/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/config/ObReaderConfig.java b/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/config/ObReaderConfig.java index f808feee520773b25221ab09c6ed920a7d458edc..5f4912ed2552ebc16bdb5dba4fe9095d4ead70d4 100644 --- a/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/config/ObReaderConfig.java +++ b/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/config/ObReaderConfig.java @@ -132,8 +132,12 @@ public class ObReaderConfig extends AbstractConnectionConfig { + ", cluster_password=******, " + "tb_white_list=" + TABLE_WHITE_LIST + + ", tb_black_list=" + + TABLE_BLACK_LIST + ", start_timestamp=" - + START_TIMESTAMP; + + START_TIMESTAMP + + ", timezone=" + + TIME_ZONE; } /** diff --git a/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/connection/ClientHandler.java b/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/connection/ClientHandler.java index c9be47e2a5b065d7162df1cc38933f0b6da693a4..d05c0dd6879ea944aec7e82f3680e52811598fac 100644 --- a/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/connection/ClientHandler.java +++ b/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/connection/ClientHandler.java @@ -226,7 +226,7 @@ public class ClientHandler extends ChannelInboundHandlerAdapter { byte[] bytes = new byte[dataLength]; buffer.readBytes(bytes); LogProxyProto.RuntimeStatus response = LogProxyProto.RuntimeStatus.parseFrom(bytes); - logger.debug("server status: {}", response.toString()); + logger.debug("Server status: {}", response.toString()); state = HandshakeStateV1.PB_HEAD; } else { dataNotEnough = true; @@ -252,18 +252,18 @@ public class ClientHandler extends ChannelInboundHandlerAdapter { */ private void checkHeader(int version, int type, int length) { if (ProtocolVersion.codeOf(version) == null) { - logger.error("unsupported protocol version: {}", version); + logger.error("Unsupported protocol version: {}", version); throw new LogProxyClientException( - ErrorCode.E_PROTOCOL, "unsupported protocol version: " + version); + ErrorCode.E_PROTOCOL, "Unsupported protocol version: " + version); } if (HeaderType.codeOf(type) == null) { - logger.error("unsupported header type: {}", type); + logger.error("Unsupported header type: {}", type); throw new LogProxyClientException( - ErrorCode.E_HEADER_TYPE, "unsupported header type: " + type); + ErrorCode.E_HEADER_TYPE, "Unsupported header type: " + type); } if (length <= 0) { - logger.error("data length equals 0"); - throw new LogProxyClientException(ErrorCode.E_LEN, "data length equals 0"); + logger.error("Data length equals 0"); + throw new LogProxyClientException(ErrorCode.E_LEN, "Data length equals 0"); } } @@ -453,8 +453,8 @@ public class ClientHandler extends ChannelInboundHandlerAdapter { poolFlag = false; logger.info( - "Connect broken of ClientId: {} with LogProxy: {}", - params.info(), + "Channel closed with ClientId: {}, LogProxy: {}", + params.getClientId(), NetworkUtil.parseRemoteAddress(ctx.channel())); ctx.channel().disconnect(); ctx.close(); diff --git a/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/connection/Connection.java b/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/connection/Connection.java index d0273ab25cd5d4f67e48d78215abbc0ca442adaa..f0463471f58da3f79cc34cd81078db41e8259f5a 100644 --- a/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/connection/Connection.java +++ b/logproxy-client/src/main/java/com/oceanbase/clogproxy/client/connection/Connection.java @@ -41,7 +41,7 @@ public class Connection { /** Close this connection. */ public void close() { if (!closed.compareAndSet(false, true)) { - logger.warn("connection already closed"); + logger.warn("Connection already closed"); } if (channel != null) { if (channel.isActive()) { @@ -49,7 +49,7 @@ public class Connection { channel.close().addListener(this::logCloseResult).syncUninterruptibly(); } catch (Exception e) { logger.warn( - "close connection to remote address {} exception", + "Close connection to remote address {} exception", NetworkUtil.parseRemoteAddress(channel), e); } @@ -68,12 +68,12 @@ public class Connection { if (future.isSuccess()) { if (logger.isInfoEnabled()) { logger.info( - "close connection to remote address {} success", + "Close connection to remote address {} success", NetworkUtil.parseRemoteAddress(channel)); } } else { logger.warn( - "close connection to remote address {} fail", + "Close connection to remote address {} fail", NetworkUtil.parseRemoteAddress(channel), future.cause()); }