Search code examples
javajersey-client

How to disable JerseyClient request logging in runtime?


How to disable JerseyClient request logging in runtime?

I've got code like that:

client = ClientBuilder.newClient();
client.register(new LoggingFeature(LOGGER, level.INFO, null, null))

I can't figure out how to disable logging in runtime? Maybe there is some config params to use?


Solution

  • If you are trying to change the logging level, just change Level.INFO with Level.WARNING or higher. (more about java.util.logging.Level).

    Or comment second line (if you don't set logger, the client will not be able to log).