11.2.15

A very simple way to change the log level of jdk logger

LogManager logManager = LogManager.getLogManager();

String config = "handlers=java.util.logging.ConsoleHandler\n"
+ ".level=FINEST\n"
+ "java.util.logging.ConsoleHandler.level=FINEST\n";
logManager.readConfiguration(new ByteArrayInputStream(config.getBytes()));

No comments: