gavlyukovskiy/spring-boot-data-source-decorator

Spring Boot 3 Support

LelvProgrammer opened this issue · 8 comments

It seems like the library is no longer working out of the box with Spring Boot 3. I read other people were having issues, and I tried it myself and wouldn't get the logs running. It'd seem as though some adaptation has to be made, but if anyone got it working with Spring Boot 3, please share.

igr commented

Second that. There are no logs in SrpingBoot3 :(

Same here. Is there a new version planned to support Spring Boot 3?

I suspect that the main change is coming from new autoconfiguration declaration mechanism introduced in 2.7. I don't think it's going to be a huge change and I'll try to look into it.

If you create a configuration file, you can see logs even if you use spring 3.0.

@Profile("local", "test")
@Configuration
@Import(DataSourceDecoratorAutoConfiguration::class)
class SqlLoggingConfiguration

This is my console log.
image

@LelvProgrammer @igr @jewolz

I can confirm that with the additional DataSourceDecorator Config I also receive logs. However, funnily enough they are written to the spy.log file, even though I have decorator.datasource.p6spy.logging = SLF4j manually configured (actually it's the default value, but somehow not used)

@ckdgus08 Did you configure something specific there as well?

The first thing (probably the easiest) that needs to be done is to change the import packages from javax to jakarta. E.g. com.github.gavlyukovskiy.boot.jdbc.decorator.p6spy.P6SpyConfiguration the imports javax.annotation.PostConstruct and javax.annotation.PreDestroy needs to be changed to jakarta.annotation.PostConstruct and jakarta.annotation.PreDestroy respectively.

Fixed via #78, released in 1.9.0

Thanks mate - I'll tell stories about you to my grandchildren