Change the logging level on-the-fly (Log4J)Tag(s): Environment
While you can set the logging level through the configuration properties file
; can be OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL log4j.threshold=WARN
... setLogLevel("DEBUG"); ... setLogLevel("INFO"); ... private void setLogLevel(String level) { Logger root = Logger.getRootLogger(); if ("DEBUG".equals(level)) { root.setLevel(org.apache.log4j.Level.DEBUG); } else { root.setLevel(org.apache.log4j.Level.INFO); } }