Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
LogFactory not initialized with the right classloader if first log is from the Flyway class #2270
5.2.4 Which version and edition of Flyway are you using?
Upgraded from 5.0.7 to 5.2.4 What did you do?
Normal log messages
What did you see instead? The exception above.
It seems to me that after the change to fluid configuration the default log creator is no longer initialized with the same class loader we use for the Configuration object. I think the default log creator should be using the same class loader as the parameter in the configuration object. If you are using multiple threads then depending on which thread you happen to be you randomly get this error.
As a workaround i make sure the first log is in the main method of my migration script.
I think there should be a connection between the log factory and the config object. Now the log factory is a singleton but when and where it is created can cause issues.
To reproduce all you have to do is create the config object this migration in a different thread than the main thread, i believe this should be enough, and of cause have some failing migration so the getLog is triggered:
Hit this as well using SBT.
I'm using Flyway to set up the test database. When running tests manually, on the first test run everything is OK, but on the second one I get the exception above. I explicitly initialize
In the first place, does
UPD: It's probably because