Skip to content

Use separate logger for PulsarListener exceptions #1039

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

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

onobc
Copy link
Collaborator

@onobc onobc commented Feb 17, 2025

This creates a separate logger for DefaultPulsarMessageListenerContainer that it uses to log exceptions thrown from listener callback methods.

The exceptions are still logged at debug level in order to not change behavior in a patch release. However, the log category used by the logger can then be set to debug level but not spam the logs with the other debug statements in the listener container.

Resolves #1008

@onobc onobc force-pushed the GH-1008-error-logger branch 2 times, most recently from f3aae64 to 299dbf6 Compare February 17, 2025 18:19
This creates a separate logger for DefaultPulsarMessageListenerContainer
that it uses to log exceptions thrown from listener callback methods.

The exceptions are still logged at debug level in order to not change
behavior in a patch release. However, the log category used by the logger
can then be set to debug level but not spam the logs with the other
debug statements in the listener container.

Also, adds exception logging to the batch listener invocation using
the same listener error logger as the record listener invocation.

Resolves spring-projects#1008
@onobc onobc force-pushed the GH-1008-error-logger branch from 299dbf6 to 5c294b9 Compare February 17, 2025 18:27
@onobc onobc merged commit fe95ac4 into spring-projects:main Feb 17, 2025
7 checks passed
@onobc onobc deleted the GH-1008-error-logger branch February 17, 2025 20:03
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.

@PulsarListener method does not log exceptions when throwing RuntimeException, how to fix it?
1 participant