logFile Parameter

To log execution details of any command, use the logFile parameter. The logFile parameter sends logging messages of what Liquibase does during runtime to a file.

If you want to set the log level for your log file, you need to specify the logLevel parameter along with the logFile parameter. If you don't specify the logLevel parameter, the default log value will be severe.

An example of running the logFile parameter

liquibase --logLevel=debug --logFile=../the/path/to/my/logs update

An example of running both logFile and outputFile parameters

To get the log and output information from a command, use the logFile and outputFile parameters simultaneously:

liquibase --outputFile=mysnapshot.json --logLevel=debug --logFile=liquibase.log snapshot

log-file CLI Usage in Liquibase 4.4+

Starting from Liquibase 4.4, there are changes in how you can configure Liquibase or how you can type commands and parameters, in particular logFile. The Liquibase CLI functionality aims to be backward compatible with all previous versions. However, it is a best practice to follow the syntax rules mentioned in the Command Line Interface instruction and in the --help output.

An example of running the log-file parameter

liquibase --log-level=debug --log-file=../the/path/to/my/logs update

An example of running both log-file and output-file parameters

liquibase --log-level=debug --log-file=liquibase.log snapshot --output-file=mysnapshot.json

Related Links