-
Notifications
You must be signed in to change notification settings - Fork 266
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
Reduce logging messages on info level #418
Conversation
d933fe0
to
5894b34
Compare
if (loggerNet.isInfoEnabled()) { | ||
loggerNet.info("From: \t{} \tRecv: \t{}", channel, msg.toString()); | ||
} | ||
loggerNet.trace("From: \t{} \tRecv: \t{}", channel, msg.toString()); |
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 would remove this .toString()
b/c this call will be made even if the TRACE level is not enabled
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.
👍
@@ -85,8 +85,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E | |||
loggerNet.debug("FrameCodec failed: ", cause); | |||
} else { | |||
if (cause instanceof IOException) { | |||
loggerNet.info("FrameCodec failed: " + ctx.channel().remoteAddress() + "(" + cause.getMessage() + ")"); | |||
loggerNet.debug("FrameCodec failed: " + ctx.channel().remoteAddress(), cause); | |||
loggerNet.info("FrameCodec failed: {} ({})", ctx.channel().remoteAddress(), cause); |
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 would recheck if passing a Throwable as last parameter for the logger methods doesn't have a different semantic in the terms of how this is resolved as part of the logging message
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.
Yes, I'll keep the trace with throwable as last parameter. It has another behavior 👍
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 mentioned this b/c of the second {}
in the message marker, I'm not sure if it'll use the throwable as part of the message or will just make it available as %ex
if (logger.isInfoEnabled()) { | ||
logger.info("Paying: txGasCost: [{}], gasPrice: [{}], gasLimit: [{}]", txGasCost, toBI(tx.getGasPrice()), txGasLimit); | ||
} | ||
logger.trace("Paying: txGasCost: [{}], gasPrice: [{}], gasLimit: [{}]", txGasCost, toBI(tx.getGasPrice()), txGasLimit); |
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.
Maybe we should keep a .isTraceEnabled()
in place, this way the toBI()
will not be invoked when the TRACE level is not enabled.
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.
toBi() shouldn't be expensive but we can keep the check
9ca6541
to
e7f3b37
Compare
@lsebrie please fix conflicts |
df776f0
to
c5ffca1
Compare
c5ffca1
to
bb85985
Compare
@@ -248,8 +248,6 @@ public void rlpParse() { | |||
byte[] r = transaction.get(7).getRLPData(); | |||
byte[] s = transaction.get(8).getRLPData(); | |||
this.signature = ECDSASignature.fromComponents(r, s, getRealV(v)); | |||
} else { | |||
logger.debug("RLP encoded tx is not signed!"); |
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.
Although I agree this line should be removed, it was still not clear what was causing it to be logged so many times. I suggest not removing it at this stage, and I'll add a new issue to go deeper into this case.
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.
maybe move it to .trace()
?
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.
Yes, @diega is right, we can move it to trace. If we can add a tx id it will be useful too, however this could also be part of investigating the issue.
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.
Ok, we keep it as trace 👍
bb85985
to
3148f14
Compare
3148f14
to
a21a8fa
Compare
SonarQube analysis reported 177 issues Top 10 issues
|
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.
Approved
Many logs were throw on info level and it makes hard to get what's happening on the node by reading logs.
Most of them were kept and demoted to trace so still can be used for debugging but are not useful for the regular user.
Still there are some logs coming from external libraries that should be turned off or silenced from logback.
There are some minor fixes on string formats or incompatible protocol.