When I run a liquibase command with the --log-file=FILENAME parameter, the log-file generation behaviour is NOT WHAT IS EXPECTED. Here’s what happens:
- When the liquibase command has ERRORS, the log-file only contains ERRORS (example: if it can’t find the mysql jdbc driver).
- When the liquibase command is SUCCESSFUL, if the log-file from a previous execution EXISTS, it is NOT overwritten with log-file output matching the screen output (STDOUT) of the liquibase command. Instead the log-file remains UNTOUCHED from the previous run of the liquibase command when it had errors!
- When I delete the log-file from a previous run of the liquibase command, and I run the liquibase command with the --log-file=FILENAME parameter specified, I get a zero-byte file generated! Instead that file should contain ALL OUTPUT from the liquibase command (equivalent to STDOUT).
Here’s the first 6 lines and last 6 lines of the log-file contents when the liquibase command can’t find the mysql jdbc driver:
[2025-07-10 11:47:40] SEVERE [liquibase.integration] Cannot find database driver: com.mysql.cj.jdbc.Driver
liquibase.exception.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: com.mysql.cj.jdbc.Driver
at liquibase.command.CommandScope.lambda$execute$6(CommandScope.java:310)
at liquibase.Scope.child(Scope.java:225)
at liquibase.Scope.child(Scope.java:201)
…
…
… 34 more
Caused by: java.lang.RuntimeException: Cannot find database driver: com.mysql.cj.jdbc.Driver
at liquibase.database.DatabaseFactory.loadDriver(DatabaseFactory.java:304)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:225)
… 37 more
*** Please submit this BUG behaviour to Liquibase Development to FIX ASAP!!! Thanks!