Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Liquibase preCondition onFailMessage not logged if logLevel is WARN

$
0
0
I'm rather new to Liquibase and I'm basically exploring this great tool (version 3.5.1), but I've just come accross a behaviour that doesn't sound right to me.

Let's consider the following changeSet:
  

  1. <changeSet author="paddy" id="tables, views and sequences:public synonyms" runAlways="true" runOnChange="true">
  2.           <preConditions onFail="WARN" onFailMessage="There are compilation errors on DB Objects">
  3.             <sqlCheck expectedResult="1">SELECT COUNT(*) FROM DBA_ERRORS WHERE UPPER(OWNER)=UPPER('${owner}') AND TYPE NOT IN ('PROCEDURE','FUNCTION','PACKAGE','PACKAGE BODY')</sqlCheck>
  4.           </preConditions>
  5.           <comment>Creation of all tables, views and sequences public synonyms</comment>
  6.           <sqlFile  path="../../sql/create_db_objects_public_synonyms.sql"
  7.                     relativeToChangelogFile="true"
  8.                     encoding="UTF-8"
  9.                     splitStatements="true"
  10.                     endDelimiter="\n/\s*\n|\n/\s*$"/>
  11.           <rollback/>
  12.         </changeSet>

I'm expecting to get the message "There are compilation errors on DB Objects" output to my log file whenever the condition fails. However I want Liquibase to proceed with the current changeSet, so this is why I set the "onFail" attribute to "WARN".

I'm using a properties file to set the "logLevel" and the "logFile" optional parameters:

  1.     logLevel: warning
  2.     logFile: ./lb_logs/liquibase.log

My problem is the message is not logged when logLevel is set to "warning" whereas it gets logged when I set the logLevel to "info", but then the log is filled with a lot of information I just don't want to see in my log file.

I thought onFail="WARN" and logLevel="warning" was a consistent setting, but maybe I'm mistaken.

Could someone help me understand this behaviour?



Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>