Skip to content
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

GH-2536: Exclusive Consumer Logging Improvements #2537

Merged
merged 3 commits into from
Oct 4, 2023

Conversation

garyrussell
Copy link
Contributor

Resolves #2536

Log messages due to access refused due to exclusive consumers at DEBUG level instead of WARN and INFO.

* @param message the message.
* @since 3.1
*/
default void logRestart(Log logger, Supplier<String> message) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use org.springframework.core.log.LogMessage instead?
And then we won't need the next isDebugEnabled()

Resolves spring-projects#2536

Log messages due to access refused due to exclusive consumers at DEBUG
level instead of WARN and INFO.
LogMessage.of(() -> "Restarting " + this.consumer));
}
else {
logger.info("Restarting " + this.consumer);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is moment when we can change that logger to the LogAccessor and use here a supplier variant?
Otherwise, consider to wrap it into isInfoEnabled()

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 will change it to a LogMessage too; I don't want to spend the effort to change to LogAccessor at this time.

@artembilan artembilan merged commit 4cf9b5c into spring-projects:main Oct 4, 2023
1 check passed
@garyrussell garyrussell deleted the GH-2536 branch October 12, 2023 14:09
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.

Exclusive Consumer Logging Improvements
2 participants