Setting logging for Liquibase facade

I don’t know how to set the Liquibase log level to “severe”.

I investigated, and I see that the Liquibase facade (liquibase.Liquibase) gets its logger by calling LogFactory.getLogger().  This, in turn, calls LogFactory.getLogger(“liquibase”).

If you attempt to set the log level of this logger, like this:

final Logger logger = LogFactory.getLogger();
logger.setLogLevel(“severe”);
final Liquibase liquibase = new Liquibase(…);

…then it appears that the log level is actually set to debug internally–or at least all kinds of debug information is printed to the log.

I dug around in the source code of DefaultLogger and discovered that it first checks a System property named liquibase.defaultlogger.level.  So it would seem that another way to do this would be to simply set this System property to, say, severe, and it should be picked up automatically.  I observed the same symptoms, however–lots of debug information in the log.

I’m obviously missing something fundamental here: how does one change the log level for all of liquibase when it is run through the facade class?

Thanks,
Laird

That should be how you set the log level, and it is working for me in my integration tests.  I call LogFactory.getLogger().setLevel(“severe”) before calling new Liquibase(…) and I just get severe messages.

Are you using the 2.0 final version?

Nathan

Originally posted by: Nathan
That should be how you set the log level, and it is working for me in my integration tests.  I call LogFactory.getLogger().setLevel("severe") before calling new Liquibase(..) and I just get severe messages.

Are you using the 2.0 final version?

Nathan

Yes; sorry for the noise; I must have been doing something else (though I can’t think what).  It seems to be working now.

L