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
Showing posts with label logback. Show all posts
Showing posts with label logback. Show all posts
Saturday, October 16, 2010
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:
Labels:
Java,
logback,
programming
Subscribe to:
Posts (Atom)