-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
Don't require sentry.dsn
to be set when using spring-boot-starter
and logback
together
#965
Conversation
This means if you don't set sentry.dsn you can still have the files on the classpath.
This only configures the logbook appender when sentry is configured by making the sentry properties a dependency on the appender auto configuration being applied. Fixes getsentry#964
Could you please add an entry to the changelog? |
This should fix #964 |
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.
Thanks for finding, reporting and fixing the bug! I think we can improve the tests a little.
contextRunner | ||
.run { | ||
assertThat(it).doesNotHaveBean(IHub::class.java) |
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.
Wouldn't it make more sense to verify if the appender is configured?
assertThat(rootLogger.getAppenders(SentryAppender::class.java)).isEmpty()
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.
Yep, I'm sure it does :-) Done.
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.
Fantastic, thank you!
@@ -29,16 +29,24 @@ class SentryLogbackAppenderAutoConfigurationTest { | |||
} | |||
|
|||
@Test | |||
fun `configures SentryAppender`() { | |||
fun `hub is not created when auto-configuration dsn is not set`() { |
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 think this test should verify that "does not configure SentryAppender when auto-configuration dsn is not set".
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.
Improved, thanks.
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.
Thanks again for your contribution!
Thanks @buckett @maciejwalkowiak |
sentry.dsn
to be set when using io.sentry:sentry-spring-boot-starter
and io.sentry:sentry-logback
together
sentry.dsn
to be set when using io.sentry:sentry-spring-boot-starter
and io.sentry:sentry-logback
togethersentry.dsn
to be set when using spring-boot-starter
and logback
together
📢 Type of change
📜 Description
This only configures the logback appender when sentry is configured by making the sentry properties a dependency on the appender auto configuration being applied.
💡 Motivation and Context
Make the configuration simpler when you don't want to use sentry (eg on developers machines)
💚 How did you test it?
sentry.dsn
but with the sentry dependencies and checked it started.📝 Checklist
🔮 Next steps