You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "weihubeats (via GitHub)" <gi...@apache.org> on 2025/06/30 08:04:17 UTC

[PR] [Enhancement] Optimize log printing [rocketmq]

weihubeats opened a new pull request, #9505:
URL: https://github.com/apache/rocketmq/pull/9505

   https://github.com/apache/rocketmq/issues/9504


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #9504] Optimize log printing [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9505:
URL: https://github.com/apache/rocketmq/pull/9505#issuecomment-4910262268

   This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #9504] Optimize log printing [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #9505: [ISSUE #9504] Optimize log printing
URL: https://github.com/apache/rocketmq/pull/9505


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #9504] Optimize log printing [rocketmq]

Posted by "weihubeats (via GitHub)" <gi...@apache.org>.
weihubeats commented on code in PR #9505:
URL: https://github.com/apache/rocketmq/pull/9505#discussion_r2188913239


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyDecoder.java:
##########
@@ -49,7 +49,7 @@ public Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
             cmd.setProcessTimer(timer);
             return cmd;
         } catch (Exception e) {
-            log.error("decode exception, " + RemotingHelper.parseChannelRemoteAddr(ctx.channel()), e);
+            log.error("decode exception, remoteAddress: {}" ,RemotingHelper.parseChannelRemoteAddr(ctx.channel()), e);

Review Comment:
   I don't understand what you mean. I used {} to replace the first parameter, and the second parameter will be printed out as an exception stack normally.
   example
   ```java
   ERROR RocketmqRemoting - decode exception, remoteAddress: 192.168.1.1
   java.lang.ArithmeticException: / by zero
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #9504] Optimize log printing [rocketmq]

Posted by "xiaoyifang (via GitHub)" <gi...@apache.org>.
xiaoyifang commented on code in PR #9505:
URL: https://github.com/apache/rocketmq/pull/9505#discussion_r2184874168


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyDecoder.java:
##########
@@ -49,7 +49,7 @@ public Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
             cmd.setProcessTimer(timer);
             return cmd;
         } catch (Exception e) {
-            log.error("decode exception, " + RemotingHelper.parseChannelRemoteAddr(ctx.channel()), e);
+            log.error("decode exception, remoteAddress: {}" ,RemotingHelper.parseChannelRemoteAddr(ctx.channel()), e);

Review Comment:
   IMO, `log.error(String,object,object)`   ,the third exception will be treated as object which is not intended .



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #9504] Optimize log printing [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9505:
URL: https://github.com/apache/rocketmq/pull/9505#issuecomment-4949315283

   This PR was closed because it has been inactive for 3 days since being marked as stale.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org