Quarkus, cannot log on unit test using slf4j

Viewed 629

I'm using Quarkus framework and I've built some unit tests using junit5 jupiter.

This is my application.properties under resources folder of my maven project:

quarkus.log.console.enable=true
quarkus.log.level=DEBUG
test.quarkus.log.level=DEBUG
dev.quarkus.log.level=DEBUG
quarkus.log.format=%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n

The logger is initialized in the usual way:

 private static final Logger logger = LoggerFactory.getLogger(MyClass.class); 

However I cannot see any logging on console. This happens ONLY in unit tests, so when starting the application things work properly.

Any hints?

1 Answers

The Quarkus logging configuration only applies to tests that are annotated with @QuarkusTest. It does not work for non Quarkus unit tests

Related