I'd like to know how to programatically turn off java logging - no property files, no command line arguments etc.
I've tried:
final Properties logProperties = new Properties();
logProperties.put("handlers", "java.util.logging.MemoryHandler");
logProperties.put(".level", "SEVERE");
logProperties.put("java.util.logging.ConsoleHandler.level", "SEVERE");
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
logProperties.store(bytes, applicationName);
new String(bytes.toByteArray());
LogManager.getLogManager().readConfiguration(new ByteArrayInputStream(bytes.toByteArray()));
but the third party library (Flying Saucer) continues to log all its messages regardless of what I do.
It doesn't matter so much in production, but it is really annoying in my IDE to get these console messages all over the show. (At a future point, I shall redirect to another logging framework...)