fahd.blog: Logback: Change root logger level programmatically
A couple of years ago, I wrote about how it is possible to change log4j logging levels using JMX. I'm now using logback, which is intended to be the successor of log4j and provides several advantages over it.The following code snippet can be used to change the root logger's logging level in logback:
import org.slf4j.LoggerFactory; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; Logger root = (Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); root.setLevel(Level.DEBUG); //change to debug |
Read full article from fahd.blog: Logback: Change root logger level programmatically
No comments:
Post a Comment