Hi everyone,
I’m using liquibase-core 4.25.1, Spring Boot in some outdated version 4 and Log4j2 included by Spring Boot. Some of my Liquibase migrations fail with possibly SQL syntax errors, but I don’t see the actual generated SQL in the exception message at all. It only mentions some syntax error and possible root causes to check, but without the actual SQL it’s not of much help. I didn’t generate that SQL on my own, but was just using indexExists
from Liquibase.
<changeSet author="dbr" id="0.9.7-HRP-143-aaaaj" dbms="db2i">
<preConditions onFail="MARK_RAN">
<not>
<indexExists tableName="AC_COSTCENTER" indexName="AC_COSTCENTER_UX"/>
</not>
</preConditions>
<createIndex indexName="AC_COSTCENTER_UX" tableName="AC_COSTCENTER" unique="true">
<column name="COMPANY_ID"/>
<column name="KEY"/>
</createIndex>
</changeSet>
From my understanding Liquibase should be able to log the SQL at some log level below INFO. Though, whatever I try I don’t get ANY log messages from Liquibase below that level. I’m able to switch between ERROR and INFO, so my configs are appliedat leats partly, but I don’t get anything below INFO and therefore most likely no SQL.
The following is my property for Spring Boot and according to different sources this should even work with my older Spring Boot. As I’m able to switch between ERROR and INFO, I guess it works in general.
logging.level.liquibase=TRACE
- Liquibase logging level in Spring Boot - Stack Overflow
- Liquibase's logging level is unaffected by general logging configuration · Issue #2916 · spring-projects/spring-boot · GitHub
The following is Log4j2, but not sure about if the logger name is correct etc. Switching between ERROR and INFO seems to work here as well, e.g. with INFO in Spring Boot and ERROR in Log4j2, I only get the error messages etc. But again, nothing below INFO.
<Loggers>
<Root level="WARN">
<AppenderRef ref="console" />
<AppenderRef ref="file" />
</Root>
<Logger name="liquibase" level="TRACE" />
<Logger name="net.veda.appmediator" level="WARN" />
</Loggers>
So how do I get the SQL logged or anything below INFO to check my settings?
Thanks!