1

I want to change jooq log level to WARN so that the below log does not show up during unit tests

2022-11-10T04:38:33.3808516Z 04:37:24.486 [com.sp.analytics.tools.snowflake.JooqBindingsGenerator.main()] DEBUG org.jooq.meta.AbstractTypedElementDefinition - Type mapping             : PUBLIC.FACT_SERVICE_CHARGE_TOMBSTONE.ROW_VERSION with type INTEGER
2022-11-10T04:38:33.3809963Z 04:37:24.486 [com.sp.analytics.tools.snowflake.JooqBindingsGenerator.main()] DEBUG org.jooq.meta.AbstractTypedElementDefinition - Type mapping             : PUBLIC.FACT_SERVICE_CHARGE_TOMBSTONE.UPDATED_AT with type TIMESTAMP

I have added the <logger name="org.jooq" level="WARN"/> in my logback-test.xml. But the above DEBUG logs are still coming.

<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
  <include resource="org/springframework/boot/logging/logback/base.xml"/>
  <root level="WARN"/>
  <!--  SnapshotVerifier prints detailed snapshot on failure. Suppress that!-->
  <logger name="au.com.origin.sn.SnVerifier" level="ERROR"/>
  <logger name="com.sp" level="DEBUG"/>
  <logger name="org.jooq" level="WARN"/>

  <!--  Suppress the noise from Kafka in tests where broker is not available. !-->
  <logger name="org.apache.kafka.clients.NetworkClient" level="ERROR"/>
</configuration>

Versions

  • logback - 1.2.3
  • slf4j - 1.7.30
  • spring-boot - 2.5.8
  • jooq - 3.14.6

Any suggestion on how can I change the log level of Jooq logger?

tuk
  • 5,941
  • 14
  • 79
  • 162
  • What is the `com.sp` shown? – Abhijit Sarkar Nov 10 '22 at 07:46
  • `org.jooq.meta` hints at code generation usage. Does your logging configuration apply to the code generation plugin / classpath? – Lukas Eder Nov 10 '22 at 08:11
  • @LukasEder - I do not understand you fully. Should not the `logback-test.xml` also be applied to the jooq code generation during `mvn test` as `logback-test.xml` has higher precedence as explained [here](https://stackoverflow.com/a/50579418/785523). – tuk Nov 10 '22 at 08:29
  • The logging is from your own code, maybe generated by JOOQ but still your own. It isn't in the `org.jooq` package but the `com.sp` package for which you enabled DEBUG logging. – M. Deinum Nov 10 '22 at 08:33
  • @M.Deinum The log is coming from a logger of the form [org.jooq](https://github.com/jOOQ/jOOQ/blob/1feeeb34c980a044004f92c3f094a2f9e13d9c65/jOOQ-meta/src/main/java/org/jooq/meta/AbstractTypedElementDefinition.java#L209) in `AbstractTypedElementDefinition`. Should not then it take the log level of `org.jooq` which I have specified in `logback-test.xml`? – tuk Nov 10 '22 at 08:40
  • Ok I think i understood what you meant. The code is generated by jooq. But when tests are getting executed, it is using the jooq generated code but the logger is the application logger `com.sp` – tuk Nov 10 '22 at 08:45

0 Answers0