@SuppressForbidden(reason="Legitimate log4j access") static boolean muteConsole(){
  try {
    if (!isLog4jActive()) {
      logNotSupported("Could not mute logging to console.");
      return false;
    }
    org.apache.log4j.Logger rootLogger=LogManager.getRootLogger();
    Enumeration appenders=rootLogger.getAllAppenders();
    while (appenders.hasMoreElements()) {
      Appender appender=(Appender)appenders.nextElement();
      if (appender instanceof ConsoleAppender) {
        log.info("Property solr.log.muteconsole given. Muting ConsoleAppender named " + appender.getName());
        rootLogger.removeAppender(appender);
      }
    }
    return true;
  }
 catch (  Exception e) {
    logNotSupported("Could not mute logging to console.");
    return false;
  }
}

@ SuppressForbidden ( reason = "Legitimate log4j access" ) static boolean muteConsole ( ) { try { if ( ! isLog4jActive ( ) ) { logNotSupported ( "Could not mute logging to console." ) ; return false ; } org . apache . log4j . Logger rootLogger = LogManager . getRootLogger ( ) ; Enumeration appenders = rootLogger . getAllAppenders ( ) ; while ( appenders . hasMoreElements ( ) ) { Appender appender = ( Appender ) appenders . nextElement ( ) ; if ( appender instanceof ConsoleAppender ) { log . info ( "Property solr.log.muteconsole given. Muting ConsoleAppender named " + appender . getName ( ) ) ; rootLogger . removeAppender ( appender ) ; } } return true ; } catch ( Exception e ) { logNotSupported ( "Could not mute logging to console." ) ; return false ; } }
disables all log4j consoleappender ' s by modifying log4j configuration dynamically . must only be used during early startup
