I struggled with this myself for several hours before finally uncovering the "secret" today.
This is somewhat counterintuitive, but the level you set with LOGGING_FEATURE_LOGGER_LEVEL_SERVER is actually the minimum level that the server logger must be set to print your logs. I assumed, based on the name, that this sets the actual level of the registrar - meaning that setting it to FINER or FINEST will increase the output volume. Instead, it is simply “turning off” the registration if a certain level is not reached.
As an example, if you set it to WARNING , you will see the logs if the server / client is configured to print at least WARNING . Levels defined by java.util.logging:
SEVERE (highest value)
WARNING
INFO
Config
FINE
FINER
FINEST (lowest value)
Therefore, setting it to WARNING (literal WARN does not work for me in 2.23.1), you will see the logs, because by default logging is usually at the INFO level.
An alternative solution is to change the default logging level in your logging.properties file, which is usually located in $JAVA_HOME/jre/lib/logging.properties . For example, you can make the following changes to the file, and you will no longer need to set any special properties in your code:
java.util.logging.ConsoleHandler.level = FINEST org.glassfish.jersey.test.JerseyTest.level = FINEST
The obvious downside of this is that it will affect everything you run from this JDK / JRE. There are ways to override this default location and use an alternative logging.properties file, but it depends on how you execute your code, so I will give you a study based on your circumstances.
An example is this thread, which explains how to do this when using Maven: Logging level in maven surefire
source share