Hi,
I’ve currently managed to configure my Spring application to work with liquibase in a way that it runs the update command whenever I start the application. The problem is that I’d like to be able to see the output log from liquibase in a different file in order to be able to clearly see what has happened to my database, without having to search the entire startup log that can get really big in size. Could you explain a bit how the “log” property of the spring bean works?
Currently I have in my log4j.properties file a line like this:
log4j.appender.liquibase=org.apache.log4j.RollingFileAppender
and I would like to use this as my default liquibase logger.
Any help or insight on this matter?
Thanks in advance.
I am not sure about the log property. I don’t see it on the SpringLiquibase class or the Liquibase class. I can give you a bit of info on how to get logging routing to Log4J.
Liquibase 3.x has its own logging implementation that uses no external logging dependencies. The default logger logs to standard out (which is what I suspect you are seeing now). In order to route Liquibase logs to another logging framework you need to place an adapter jar on your classpath. I did some searching and found a couple of links about the log4j logging adapter:
Maven Central - Log4j Liquibase
Liqubase Wiki on Logging extensions
If you are using SLF4J as a logging facade there is also an extension to route Liquibase logs to that (Full Disclosure: I wrote that library).
Github - liquibase-slf4j
Once the adapter jar is on your classpath, the configuration you have defined above should start to function as you expect.
I hope this helps.