Spring Boot Unit Test ignores logging.level

Okay what I did now, in all modules I configured as follows:

src/main/resources:
I use logging configuration in application.properies like logging.level.* as described in the question.

src/test/resources:
I use logback-test.xml like:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/base.xml" />
    <logger name="*.myapp" level="error" />
    <logger name="org.springframework.core " level="error" />
    <logger name="org.springframework.beans" level="error" />
    <logger name="org.springframework.context" level="error" />
    <logger name="org.springframework.transaction" level="error" />
    <logger name="org.springframework.web" level="error" />
    <logger name="org.springframework.test" level="error" />
    <logger name="org.hibernate" level="error" />
</configuration>

But I still don’t understand, why in few modules I could use application.properties, but in another module it ignores … But for now it works for me as it is.

But maybe few hints with background knowledge are still welcome.

I dont mark my answer as solution, cos it still feels like a workaround.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)