Disabling Log4J Output in Java

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);
}