Skip to content
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

SLF4J Autodetection doesn't work with SLF4J 2.0 #3730

Closed
hho opened this issue Aug 22, 2023 · 3 comments
Closed

SLF4J Autodetection doesn't work with SLF4J 2.0 #3730

hho opened this issue Aug 22, 2023 · 3 comments

Comments

@hho
Copy link

hho commented Aug 22, 2023

Bug report

Which version and edition of Flyway are you using?

9.21.0 Community

If this is not the latest version, can you reproduce the issue with the latest one as well? (Many bugs are fixed in newer releases and upgrading will often resolve the issue)

Yes.

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Java API

Which database are you using? (Type & version)

PostgreSQL 15.3

Which operating system are you using?

Kubuntu 22.04

What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)

I ran Flyway in an integration test project with logback-classic 1.4.8 and slf4j-api 2.0.7 on the classpath.

What did you expect to see?

Flyway logging via SLF4J

What did you see instead?

Flyway logging to stderr

Cause

I debugged through the issue and found that the error seems to be here – while the detection of the newer SLF4J version works fine (L.63), the result is afterwards set back to false, because the new implementation isn't returned by the ServiceLoader mechanism (empty stream -> allMatch is trivially true -> slf4j is marked as not available).

As Flyway uses the old SLF4J 1.7 API, and the check introduced in 9.16.2 only seems to be to exclude the slf4j-nop binding added to flyway-commandline, I'd suggest doing the check only for the old API as well.

@Barry-RG
Copy link
Contributor

Thank you for the information @hho. I will bring this up with our team

@JasonLuo-Redgate
Copy link

Hi @Barry-RG , we already have a ticket for known issue here https://github.com/red-gate/flyway-main/issues/2712

@JasonLuo-Redgate
Copy link

This duplicates with #3651 and #3659

tjs145 added a commit that referenced this issue Sep 21, 2023
Please see the GH release for the release notes

Closes #3741: update mariadb-java-client to 2.7.10

improve parsing of statements containing multiple sets of parentheses

add support for mariadb 10.11

Closes #3731, Closes #3730: Make SLF4J detection also work with SLF4J 2.0

Update readmes copyright dates. Closes #3739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants