Skip to content

GH-2536: Exclusive Consumer Logging Improvements#2537

Merged
artembilan merged 3 commits intospring-projects:mainfrom
garyrussell:GH-2536
Oct 4, 2023
Merged

GH-2536: Exclusive Consumer Logging Improvements#2537
artembilan merged 3 commits intospring-projects:mainfrom
garyrussell:GH-2536

Conversation

@garyrussell
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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