Liquibase 3.2.2 :: DefaultLogger output to error

I would like to know why the DefaultLogger is using error output by default.



public
class DefaultLogger extends AbstractLogger {


private String name = “liquibase”;

private PrintStream err = System.err;

protected
void print(LogLevel logLevel, String message) {

  if (StringUtils.trimToNull(message) == null) {

      return;

  }

 <b> err.println</b>(logLevel + " " +

DateFormat.getDateTimeInstance(DateFormat.SHORT,
DateFormat.SHORT).format(new Date()) + ": " + name +
": " + buildMessage(message));

}There is a reason for that ? why not system.out ?


Thanks in advance,

The main reason is to separate log messages from “normal” output when running commands like updateSql which writes the SQL to stdout. If they both went on the same channel the file you get from running updateSql > file.sql would not be valid SQL.

Nathan

Hi Nathan,

I understand the approach, but maybe it is a better idea to do it configurable ?

We are using a tool that run Liquibase script in a shell script, and because it is running the output in error, looks like it is failing all the time, when it is not.

Thanks in advance,

It would be good to be more configurable. I’m working on how logging works in general with Liquibase 4.0 and will try to improve the options.

Nathan