Turning off logging in Liquibase 4.11

I’m trying to get help with logging and my post got blocked!!!

I need assistance, how can I ready some of the support staff?

Hi there, @ggb667 - Thanks for reaching out! Our Akismet filtering is sometimes a little over-enthusiastic about protecting the forum from spammers, but rest assured, your post was not blocked, it was just put in a queue for us to review and make sure it wasn’t spam. It’s been approved and should be live on the site. If you’re a Liquibase Pro or Enterprise user, you also have access to our customer success team for support, and they can be reached from this page: Expert Liquibase Support | Liquibase.com

Kind Regards,
Technical Community Manager

Thank you. I (and my whole team at John Deere actually) are having extreme problems getting logging working in 4.11.0 liquibase. We are trying to set the logging to OFF when doing testing, or maybe WARN or SEVERE, but none of the dozens of ways we have tried to configure it have worked. The only thing that had ANY effect at all is setting the overall maven logging level, but that affects everything, not just liquibase and we can’t really run that way.

Liquibase now follows the maven log configuration, we no longer have our own special set up for maven logging.

You should be able to set certain channels via maven so it doesn’t set the logging for everything.

I believe this is the PR that implemented the change Mark liquibase-maven-plugin logging configuration as deprecated by nvoxland · Pull Request #2261 · liquibase/liquibase · GitHub

Is there a maven pom example that shuts up the logging to a reasonable level?

Configuration changes seem to have no effect whatsoever on making it be quiet.

I believe logback is also in use.

Yes, maven uses slf4j for logging and we hook into that.

So by default it will log everything across all the plugins (including liquibase) with info level logging. The -X maven argument will log everything (including liquibase) at fine level.

If you want to control the logging of specific logging channels, you can do that as well Maven – Maven 3.1.x logging has a not super detailed pointer, but does list the ${maven.home}/conf/logging/simplelogger.properties file where it has the maven-install-specific defaults, and how you can add -D flags to MAVEN_OPTS to override those defaults on a per-call basis.

One of those is org.slf4j.simpleLogger.log.a.b.c for the level for the channel. So you could use org.slf4j.simpleLogger.log.liquibase=warn to limit the liquibase logging level to “warn”


I tried

export MAVEN_OPTS=“-Dorg.slf4j.simpleLogger.log.liquibase=ERROR -Dliquibase.sql.logLevel=ERROR -Dliquibase.logLevel=ERROR”

but it was completely ignored.

Still getting a ton of
INFO: ChangeSet database/static-data.xml::static-test-data-clear-reference-chemical-table::as77566 ran successfully in 8ms
Running Changeset: database/static-data.xml::static-test-data-clear-fertilizer-table::as77566
Jul 01, 2022 3:34:41 PM liquibase.changelog
INFO: Data deleted from FERTILIZER
Jul 01, 2022 3:34:41 PM liquibase.changelog

I also tried insanity like this:

            Logger schemaUpdate = (Logger) LoggerFactory.getLogger(SchemaUpdate.class);
            OutputStream os = new LogOutputStream(schemaUpdate);
            Writer output = new OutputStreamWriter(os);
            LoggingExecutor loggingExecutor = new LoggingExecutor(Scope.getCurrentScope().getSingleton(ExecutorService.class).getExecutor("jdbc", lbase.getDatabase()), output, lbase.getDatabase());
            Scope.getCurrentScope().getSingleton(ExecutorService.class).setExecutor("logging", lbase.getDatabase(), loggingExecutor);
            Scope.getCurrentScope().getSingleton(ExecutorService.class).setExecutor("jdbc", lbase.getDatabase(), loggingExecutor);