Allow flyway loggers to be configured and provide SLF4J default
Add `spring.flyway.loggers` property which can be used to configure Flyway loggers and has a default value of "slf4j". Closes gh-35158
This commit is contained in:
@@ -763,6 +763,21 @@ class FlywayAutoConfigurationTests {
|
||||
.run((context) -> assertThat(context).hasSingleBean(ResourceProviderCustomizer.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void loggers() {
|
||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||
.run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().getLoggers())
|
||||
.containsExactly("slf4j"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void overrideLoggers() {
|
||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||
.withPropertyValues("spring.flyway.loggers=log4j2")
|
||||
.run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().getLoggers())
|
||||
.containsExactly("log4j2"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldRegisterResourceHints() {
|
||||
RuntimeHints runtimeHints = new RuntimeHints();
|
||||
|
||||
Reference in New Issue
Block a user