sql-log-level

The --sql-log-level parameter controls the amount of messages that are generated from SQL statements in Liquibase. You can set --sql-log-level to the following values:

  • SEVERE (least verbose): Show serious failures that may prevent program execution.
  • WARNING: Show potential problems for program execution.
  • INFO: Show informational messages.
  • FINE (most verbose; formerly DEBUG): Show tracing information of program execution and minor failures.
  • OFF: Hide all log messages.

If you set --sql-log-level to a particular level, it will show all messages at that level and less verbose levels. For example, setting the SQL log level to SEVERE only shows SEVERE SQL logs, but setting it to FINE shows FINE, INFO, WARNING, and SEVERE SQL logs. The --sql-log-level default value is FINE.

Note: The --log-level property is required for --sql-log-level to operate successfully.

Uses

In Liquibase 4.6.2+, the --sql-log-level parameter lets you set the log level for SQL output that Liquibase generates. This allows you to have different log levels for Liquibase output and the output of the SQL Liquibase runs.

If you don't specify a value for --sql-log-level, all SQL output is generated according to the --log-level parameter.

Syntax

You can set this parameter in the following ways:

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

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.sql.logLevel=<string>
Liquibase Environment Variables
LIQUIBASE_SQL_LOG_LEVEL=<string>

For more information, see Working with Command Parameters.

Output

The following examples show the Liquibase logs of when you omit the name of the table in your CREATE_TABLE statement. The examples assume that --log-level=SEVERE:

[2024-05-30 14:31:38] FINE [liquibase.integration] Performance monitoring disabled
[2024-05-30 14:31:38] INFO [liquibase.integration] Starting command execution.
[2024-05-30 14:31:38] FINE [liquibase.command] Found ProUpdateCommandStep override for UpdateCommandStep! Using ProUpdateCommandStep in pipeline.
[2024-05-30 14:31:38] FINE [liquibase.command] Found ProChangeExecListenerCommandStep override for ChangeExecListenerCommandStep! Using ProChangeExecListenerCommandStep in pipeline.
[2024-05-30 14:31:38] FINE [liquibase.command] Found ProChangeExecListenerCommandStep override for ChangeExecListenerCommandStep! Using ProChangeExecListenerCommandStep in pipeline.
[2024-05-30 14:31:38] FINE [liquibase.configuration] No configuration value for liquibase.outputFile found
[2024-05-30 14:31:38] FINE [liquibase.servicelocator] Loaded liquibase.io.OutputFileHandler instance liquibase.io.StandardOutputFileHandler
[2024-05-30 14:31:38] FINE [liquibase.servicelocator] Loaded liquibase.io.OutputFileHandler instance com.datical.liquibase.ext.io.ProOutputFileHandler
[2024-05-30 14:31:38] FINE [liquibase.configuration] No configuration value for liquibase.strict found
[2024-05-30 14:31:38] FINE [liquibase.configuration] Configuration liquibase.strict is using the default value of false
[2024-05-30 14:31:38] WARNING [liquibase.configuration] Potentially ignored key(s) in file exists at path liquibase.properties
 - 'sqlLogLevel'

 (...)

[2024-05-30 14:31:38] SEVERE [liquibase.changelog] ChangeSet changelog.xml::3::nvoxland encountered an exception.
[2024-05-30 14:34:30] INFO [liquibase.integration] Starting command execution.
[2024-05-30 14:34:30] WARNING [liquibase.configuration] Potentially ignored key(s) in file exists at path liquibase.properties
 - 'sqlLogLevel'
[2024-05-30 14:34:30] INFO [liquibase.database] Set default schema name to PUBLIC
[2024-05-30 14:34:30] INFO [liquibase.changelog] Reading from PUBLIC.DATABASECHANGELOG
[2024-05-30 14:34:30] INFO [liquibase.lockservice] Successfully acquired change log lock
[2024-05-30 14:34:30] INFO [liquibase.command] Using deploymentId: 7090470930
[2024-05-30 14:34:30] INFO [liquibase.changelog] Reading from PUBLIC.DATABASECHANGELOG
[2024-05-30 14:34:30] INFO [liquibase.ui] Running Changeset: changelog.xml::3::nvoxland
[2024-05-30 14:34:31] SEVERE [liquibase.changelog] ChangeSet changelog.xml::3::nvoxland encountered an exception.
[2024-05-30 14:35:32] WARNING [liquibase.configuration] Potentially ignored key(s) in file exists at path liquibase.properties
 - 'sqlLogLevel'
[2024-05-30 14:35:32] SEVERE [liquibase.changelog] ChangeSet changelog.xml::3::nvoxland encountered an exception.
[2024-05-30 14:36:44] SEVERE [liquibase.changelog] ChangeSet changelog.xml::3::nvoxland encountered an exception.

Related links