log-file

To log execution details of any command, use the log-file parameter. The log-file 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 log-level along with the log-file parameter. If you don't specify the log-level parameter, the default log value will be severe.

Tip: For best results, specify all commands and parameters in the --kebab-case format in the CLI. If your preference is camelCase, it also works in the CLI.

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

To get the log and output information from a command, use the log-file and output-file parameters simultaneously:

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

Syntax

For more information, see Working with Command Parameters. You can set this parameter in the following ways:

Option Syntax
Liquibase properties file
liquibase.logFile: <string>
Global CLI parameter
liquibase
 --log-file=<string> update
 --changelog-file=mychangelog.xml

JVM system property

JAVA_OPTS Environment Variable

macOS/Linux:
JAVA_OPTS=-Dliquibase.logFile=<string>
Windows:
set JAVA_OPTS=-Dliquibase.logFile=<string>
Liquibase Environment Variables macOS/Linux:
LIQUIBASE_LOG_FILE=<string>
Windows:
set LIQUIBASE_LOG_FILE=<string>

Note: These commands only apply to the current shell. To set permanent environment variables, see Liquibase Environment Variables.

Related links