/** * Helper method the change the log-level for a given logger. * <p> * By default the system configuration is used to set the leg level (logging.[name]=LEVEL). Also the "logger" * command in the console can be used to change the log level at runtime. * * @param logger the name of the logger to change * @param level the desired log level */ public static void setLevel(String logger, Level level) { // Setup log4j Logger.getLogger(logger).setLevel(level); // Setup java.util.logging java.util.logging.Logger.getLogger(logger).setLevel(convertLog4jLevel(level)); // Clear cached "isFINE" flag to be consistently re-computed on the next access. for (Log log : all) { if (log.getName().equals(logger)) { log.fineLogging = null; } } }