Skip to content

Conversation

@oven
Copy link
Contributor

@oven oven commented Oct 19, 2021

Logging XML at the Info level seems a little too much. Move this to debug instead.

}
final Hello hello = builder.build();
log.info("hello is: {}", hello.getXml());
if (log.isDebugEnabled()) log.debug("hello is: {}", hello.getXml());
Copy link
Contributor

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.

See https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Logger.html#debug-java.lang.String-org.apache.logging.log4j.util.Supplier...-

Copy link
Contributor Author

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".

Copy link
Contributor

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?

@GregDThomas
Copy link
Contributor

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.

@senderic
Copy link
Contributor

senderic commented Nov 18, 2021 via email

@oven
Copy link
Contributor Author

oven commented Nov 19, 2021

Adding log4j2 as a dependency will have consequences for applications using netconf-java. Please don’t.

@oven
Copy link
Contributor Author

oven commented Dec 9, 2021

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?

@ydnath
Copy link
Member

ydnath commented Jul 26, 2022

+1 to full XML logging in debug level. This can get very large depending on the RPC context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants