How to disable JooQ's self-ad message in 3.4+?

This seems to work for me:

static {
    LogManager.getLogManager().reset();
}

This is also indicated as a solution a couple of times in this Stack Overflow question.

Note that version 3.6+ will also ship with a system property that can be used to deactivate displaying this logo:

-Dorg.jooq.no-logo=true

On v3.6 and higher you can do:

System.getProperties().setProperty("org.jooq.no-logo", "true");

That message is located in the org.jooq.impl.DefaultRenderContext source file and it is using the org.jooq.Constants logger. Here is the relevant source code:

    /* [trial] */ 
    JooqLogger l = JooqLogger.getLogger(Constants.class); 
    String message;
    message = "Thank you for using jOOQ " + Constants.FULL_VERSION;

    /* [pro] xx 
    xxxxxxx x xxxxxx xxx xxx xxxxx xxx xx xxx xxxx xxxx x x xxxxxxxxxxxxxxxxxxxxxx x x xxxxx xxxxxxxxx 
    xx [/pro] */ 

Looks like the message is generated because you are using a trial version. I would assume that upgrading to the pro version would disable the message. What else could be better way to show that you are a big fan of the project?

Otherwise, if you can live with the guilt and shame, you could disable info messages from the org.jooq.Constants logger by setting the level to WARNING.

This can be done adding the following to your logging.properties:

#ThanksNoThanks
org.jooq.Constants.level=WARNING

Or in Java code by calling the following methods:

//SorryNotSorry
private static final JOOQ_AD_LOGGER = Logger.getLogger("org.jooq.Constants");
static {
   JOOQ_AD_LOGGER.setLevel(Level.WARNING);
}

Make sure you stay in compliance with your jOOQ License and Maintenance Agreement:

jOOQ License and Maintenance Agreement: 
* ----------------------------------------------------------------------------- 
* Data Geekery grants the Customer the non-exclusive, timely limited and 
* non-transferable license to install and use the Software under the terms  of 
* the jOOQ License and Maintenance Agreement. 
* 
* This library is distributed with a LIMITED WARRANTY. See the jOOQ License 
* and Maintenance Agreement for more details: http://www.jooq.org/licensing 
*/ 

Tags:

Java

Logging

Jooq