diff --git a/src/main/java/io/streamnative/kop/KafkaCommandDecoder.java b/src/main/java/io/streamnative/kop/KafkaCommandDecoder.java index d055ad58aa..0cc7270cba 100644 --- a/src/main/java/io/streamnative/kop/KafkaCommandDecoder.java +++ b/src/main/java/io/streamnative/kop/KafkaCommandDecoder.java @@ -142,9 +142,9 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception try (KafkaHeaderAndRequest kafkaHeaderAndRequest = byteBufToRequest(buffer, remoteAddress)){ if (log.isDebugEnabled()) { - log.debug("[{}] Received kafka cmd {}", + log.debug("[{}] Received kafka cmd {}, the request content is: {}", ctx.channel() != null ? ctx.channel().remoteAddress() : "Null channel", - kafkaHeaderAndRequest.getHeader()); + kafkaHeaderAndRequest.getHeader(), kafkaHeaderAndRequest); } switch (kafkaHeaderAndRequest.getHeader().apiKey()) { @@ -232,8 +232,11 @@ protected void writeAndFlushResponseToClient(Channel channel) { try { ResponseAndRequest pair = response.join(); if (log.isDebugEnabled()) { - log.debug("Write kafka cmd response back to client. request: {}", - pair.getRequest().getHeader()); + log.debug("Write kafka cmd response back to client. \n" + + "\trequest content: {} \n" + + "\tresponse content: {}", + pair.getRequest().toString(), + pair.getResponse().toString(pair.getRequest().getRequest().version())); } ByteBuf result = responseToByteBuf(pair.getResponse(), pair.getRequest());