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.

Uses

By default, Liquibase sends command output to STDOUT (the console). However, you can use log-file to record this information in a permanent location.

If you want to set the log level for your log file, you also need to specify the log-level parameter. If you don't specify the log-level parameter, the default log value will be SEVERE.

Example: log-file

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

Example: log-file and output-file

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

You can set this parameter in the following ways:

Option Syntax
Liquibase properties file (defaults file)
liquibase.logFile: <string>
Global flow file argument (example)
stages:
  Default:
    actions:
      - type: liquibase
        command: update
        globalArgs: { log-file: "<string>" }
Global CLI parameter
liquibase
 --log-file=<string> update
 --changelog-file=example-changelog.xml

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.logFile=<string>
Liquibase Environment Variables
LIQUIBASE_LOG_FILE=<string>

For more information, see Working with Command Parameters.

Related links