I am trying to debug a spring boot application during tests especially see the log output.
I am not sure how to get the same autoconfigure log output during tests as the one I get when I run the application.
I have tried this (from src/main/resources/application-test.properties
):
logging.level.org.springframework.boot.autoconfigure.test=DEBUG
and
logging.level.org.springframework.boot.autoconfigure=DEBUG
By the way I use log4j with the following configuration (from src/main/resources/log4j.properties
):
log4j.rootLogger=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
edit: I have migrated to logback. Here is my src/main/resources/logback-test.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>
<logger name="org.springframework.boot.autoconfigure" level="debug"/>
<root level="warn">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
I still don't get any autoconfigure information during tests...