-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
add property to specify the loggers where the SentryAppender is attached #2173
Conversation
@marbon87 thank you for opening this PR. Can you provide some more details on how you configure your logback loggers and appenders. As an alternative to this PR developers can also simply add the SentryAppender to their |
@adinauer the loggers are configured like this:
If i manually define the SentryAppender in logback.xml and use appender-ref for all loggers, i cannot use the comfortable configuration through spring boot by setting properties like sentry.context-tags. |
Nothing's missing as far as I know, I just didn't get around to doing the review yet - sorry. |
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.
Thank you for the contribution @marbon87 and sorry for taking so long - we've been pretty busy lately. I've changed the PR a bit, can you please take another look and tell me what you think about them. If you're OK with them, I'll merge the PR.
return loggers; | ||
} | ||
|
||
public void setLoggers(final @NotNull List<String> loggers) { |
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 had to add the setter here to make the new test pass.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2173 +/- ##
============================================
+ Coverage 81.14% 81.17% +0.02%
- Complexity 4096 4102 +6
============================================
Files 333 333
Lines 15193 15213 +20
Branches 1980 1980
============================================
+ Hits 12329 12349 +20
Misses 2084 2084
Partials 780 780
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Sorry @adinauer, i overlooked your feedback. Your changes look good to me. |
Any updates on this? |
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've added a changelog entry and duplicated the changes into the jakarta module (for Spring Boot 3). I've also moved the config properties under sentry.logging
. Thanks @marbon87 🚀
📜 Description
This pull-request adds the property sentry.loggers, which can be configured with a list of loggers, where the sentry appender is registered and defaults to the ROOT logger.
💡 Motivation and Context
The current implementation of the spring-boot-starter-sentry registers the sentry appender only to the root logger.
If the logback configuration contains loggers, that are not additive, the log messages from children of the non addtive logger are not sent to sentry.
💚 How did you test it?
Added a new test to SentryLogbackAppenderAutoConfigurationTest
📝 Checklist
🔮 Next steps