-
Notifications
You must be signed in to change notification settings - Fork 65
Reduce logging at info level #53
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: master
Are you sure you want to change the base?
Conversation
@@ -72,7 +72,7 @@ public static Hello from(final String xml) | |||
builder.capability(node.getTextContent()); | |||
} | |||
final Hello hello = builder.build(); | |||
log.info("hello is: {}", hello.getXml()); | |||
if (log.isDebugEnabled()) log.debug("hello is: {}", hello.getXml()); |
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.
If this project switched to Log4j2, we could use suppliers as the arguments into log.debug
. By doing this, no need for this if
statement at the start. If debug is not enabled, the supplier will never get called.
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 agree, but at the moment this project does not use Log4j2. The point of this PR is to move logging from "Info" to "Debug".
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.
Curious on estimate of how much work it would be to switch to Log4j2?
Should be trivial, little more than swapping out If that's something you'd be interested in, I'm more than happy to submit a PR with that change in. |
I'm out of town so can't integrate log4j2 just now, but I think we'd also
need to update some of the Maven dependencies. Not too complicated but more
than just changing an annotation.
…On Thu, Nov 18, 2021, 9:57 AM GregDThomas ***@***.***> wrote:
Curious on estimate of how much work it would be to switch to Log4j2?
Should be trivial, little more than swapping out @slf4j for @log4j2 plus
dependencies.
If that's something you'd be interested in, I'm more than happy to submit
a PR with that change in.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#53 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGFW5EKTQHHSY6R6QO5C7TUMU5CJANCNFSM5GJDWIJA>
.
|
Adding log4j2 as a dependency will have consequences for applications using netconf-java. Please don’t. |
Logging frameworks aside, can we agree that full xml logging belongs on the debug level and not the info level, so we can close and merge this pull request? |
+1 to full XML logging in debug level. This can get very large depending on the RPC context. |
Logging XML at the Info level seems a little too much. Move this to debug instead.