-
Notifications
You must be signed in to change notification settings - Fork 11.9k
[ISSUE #9504] Optimize log printing #9505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
[ISSUE #9504] Optimize log printing #9505
Conversation
…o weihubeats/develop
…o weihubeats/develop
…o weihubeats/develop
…o weihubeats/develop
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, log.error(String,object,object)
,the third exception will be treated as object which is not intended .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
ERROR RocketmqRemoting - decode exception, remoteAddress: 192.168.1.1
java.lang.ArithmeticException: / by zero
#9504