Java SDK 1.8.0_131
Now I’ve succeeded in having the custom logger picked up when running in the unit tests.
Now I have liquibase logging to the karaf log instead of flooding the karaf console.
It wasn’t easy, but I got help: see this message on the karaf user mailing list
In short, what’s needed, is:
- A maven module that rebundles the liquibase-slf4j maven dependency into an OSGi bundle fragment that is connected to the org.liquibase.core OSGi bundle (ie. the liquibase-core maven dependency)
- A karaf feature that loads the rebundled liquibase-slf4j OSGi fragment before it loads liquibase-core
Note. The classloader will not find the liquibase.ext.logger.slf4j package if it is made available as a package exported by an OSGi bundle. It has to be “included” into the org.liquibase.core bundle.
Here’s a karaf feature that will install liquibase-core and fix the log: https://github.com/steinarb/liquibase-karaf-feature
- clone this project and build it with maven:
mkdir -p ~/git cd ~/git git clone https://github.com/steinarb/liquibase-karaf-feature/ cd liquibase-karaf-feature mvn clean install
- start karaf and give the following commands to the karaf console:
feature:repo-add mvn:no.priv.bang.karaf/liquibase-core-karaf/LATEST/xml/features feature:install liquibase-core
I have deployed the liquibase-core karaf feature https://github.com/steinarb/liquibase-karaf-feature to maven central.
The deployed feature has version 3.5.3 and will load liquibase 3.5.3 (and redirect the liquibase logs to the karaf logs).
To load the feature, type the following commands in the karaf console: https://github.com/steinarb/liquibase-karaf-feature#installing-the-liquibase-feature-in-karaf
To depend on the liquibase-core feature from a karaf feature file, reference the liquibase-core feature repository before referencing the liquibase-core feature: https://github.com/steinarb/liquibase-karaf-feature#using-liquibase-from-a-karaf-feature
Hi Steinar Bang,
can you please have a look at the upcoming changes to the Liquibase Logging for 3.6 and if it’s still possible to run Liquibase in Karaf with them applied?
now is the time the request changes if necessary.
Hi, I never saw this post, but the karaf liquibase logging fix works for version 3.5.3 and for 3.8.0 (which is the last version I was able to create a working feature for), so I’m assuming it works for all versions in between.
Right now I have high hopes for the upcoming 3.10.2…