Disabling Log4J Output in Java
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);
}
Set level to OFF (instead of DEBUG, INFO, ....)