How can one quickly turn off all Log4J output using a log4j.properties
file?
Set level to OFF (instead of DEBUG, INFO, ....)
If you want to turn off logging programmatically then use
List<Logger> loggers = Collections.<Logger>list(LogManager.getCurrentLoggers()); loggers.add(LogManager.getRootLogger()); for ( Logger logger : loggers ) { logger.setLevel(Level.OFF); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With