private static void updateSniffingLoggersLevel ( Logger logger ) { InputStream settingIS = FoundationLogger . class . getResourceAsStream ( "/sniffingLogger.xml" ) ; if ( settingIS == null ) { logger . debug ( "file sniffingLogger.xml not found in classpath" ) ; } else { try { SAXBuilder builder = new SAXBuilder ( ) ; Document document = builder . build ( settingIS ) ; settingIS . close ( ) ; Element rootElement = document . getRootElement ( ) ; List < Element > sniffingloggers = rootElement . getChildren ( "sniffingLogger" ) ; for ( Element sniffinglogger : sniffingloggers ) { String loggerName = sniffinglogger . getAttributeValue ( "id" ) ; Logger . getLogger ( loggerName ) . setLevel ( Level . TRACE ) ; } } catch ( Exception e ) { logger . error ( "cannot load the sniffing logger configuration file. error is: " + e , e ) ; throw new IllegalArgumentException ( "Problem parsing sniffingLogger.xml" , e ) ; } } }
The sniffing Loggers are some special Loggers whose level will be set to TRACE forcedly .