jOOQ's built-it JooqLogger
tries to resolve an optional logger dependency in the following order:
- If slf4j is found on the classpath, that is used
- Else, if log4j is found on the classpath, that is used
- Else,
java.util.logging
is used
So, as soon as the JooqLogger
finds slf4j on the classpath (e.g. as a transitive dependency from spring boot), it will use that as a logging framework. This is reasonable, because slf4j can be configured to delegate to any other logging framework, including log4j and java.util.logging
.
So, in order to enable jOOQ's debug logging via logback and Spring Boot, it is sufficient to put the following logback.xml
file at your classpath root:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<logger name="org.jooq" level="DEBUG"/>
</configuration>
This is now also reflected in the jOOQ-spring-boot-example on GitHub.
Some more ideas can be found here in the Spring Boot manual:
https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html