Im using Liquibase via ANT tasks in a production environment and need to log the output of the console logging to a file also, as when clients install DB, we need to record output and sometimes trouble shoot.
I have added the liquibase-jul-1.0.jar to my ANT classpath, but I dont know how to configure the logger with a properties file? And where this file goes? Do I also have to pass in an ANT system property so that ANT picks up the file?
Im open to using either log4j or java logging, so any complete example is appreciated. I dont see any posted on forums or the extensions portal.
Thanks a lot for the effort on this great product,
Colm
P.s im also interestd in logging the SQL to a file too… Is P6SPY the best practice mechanism for this?
I’m not entirely sure how to help you here; as the link mentions, java.util.logging construct, not a Liquibase construct, and not anything that my logging extension looks for explicitly. Java’s logging configuration affects the JVM as a whole, regardless of what tool you might happen to be running.
I would invest your time in reading the link I mentioned to understand how Java logging works. It will help you in other projects as well.
Thanks for the reply, so I am persuming that once I have a logging.properties file, I only need to have the Liquibase Juli extension on my classpath and the logging.properties file (say in same directory as build.xml) for Liquibase to pick it up?
I suppose Im not clear on how Liqubase finds this file, without me explicitly passing it a location via Ant, command line or otherwise… and in my environment, im running liquibase standalone via ANT tasks…
Thanks Laird for you responses, however my original question, I beleive - was not connected to Log4J or Java logging, I already am familar with these tools - its specifically targeted at other peoples experiences of how to use Ant and Liquibase (with Logging extensions). I was hoping someone could share what they did so I could cross reference.
Simply, in my case Liquibase was not picking up my logging configuration. I was not sure why, perhaps because the ANT process was spawning a new JVM instance when starting liquibase, which did not inherit the original classpath? (guessing here?) … anyhow, I think some documentation on how people set up this kind of logging would be useful to end-users.