How to dynamically change log level in SLF4j OR Log4J
java, log4j, logging, slf4j
Solution
Consider Logback http://logback.qos.ch/ - "a successor to the popular log4j project, picking up where log4j leaves off". If instructed to do so, logback-classic will scan for changes in its configuration file and automatically reconfigure itself when the configuration file changes. Besides, you can control Logback's logging levels with JMX.
Problem
Recently I encountered a situation where Application `Loglevel` changes dynamically. Application Admin can set it to `INFO/DEBUG/ WARN` from front end. Based on the log level choosen be him application logging must be changed. I am sure loggers support this scenario. How can I achieve this?