@Test public void attachAppenderTo() { Map<String, Level> logLevelCache = new HashMap<String, Level>(); String loggerName = "testLogger"; Log log = LogFactory.getLog( loggerName ); assertTrue( log instanceof Log4JLogger ); Log4JLogger log4jLogger = (Log4JLogger) log; Logger logger = log4jLogger.getLogger(); assertNotNull( logger ); assertFalse( logger.getAllAppenders().hasMoreElements() ); try { JobEntryUtils.attachAppenderTo( MOCK_APPENDER, LogLevel.DETAILED, logLevelCache, loggerName ); assertTrue( logger.getAllAppenders().hasMoreElements() ); assertEquals( 1, logLevelCache.size() ); } finally { logger.removeAllAppenders(); } }
public static void attachAppenderTo( Appender appender, LogLevel logLevel, Map<String, Level> logLevelCache, String... logNames ) { for ( String logName : logNames ) { Logger logger = findLogger( logName ); logger.addAppender( appender ); Level level = org.pentaho.di.core.logging.KettleLogChannelAppender.LOG_LEVEL_MAP.get( logLevel ); if ( level != null ) { logLevelCache.put( logger.getName(), logger.getLevel() ); logger.setLevel( level ); } } }
JobEntryUtils { public static void attachAppenderTo( Appender appender, LogLevel logLevel, Map<String, Level> logLevelCache, String... logNames ) { for ( String logName : logNames ) { Logger logger = findLogger( logName ); logger.addAppender( appender ); Level level = org.pentaho.di.core.logging.KettleLogChannelAppender.LOG_LEVEL_MAP.get( logLevel ); if ( level != null ) { logLevelCache.put( logger.getName(), logger.getLevel() ); logger.setLevel( level ); } } } }
JobEntryUtils { public static void attachAppenderTo( Appender appender, LogLevel logLevel, Map<String, Level> logLevelCache, String... logNames ) { for ( String logName : logNames ) { Logger logger = findLogger( logName ); logger.addAppender( appender ); Level level = org.pentaho.di.core.logging.KettleLogChannelAppender.LOG_LEVEL_MAP.get( logLevel ); if ( level != null ) { logLevelCache.put( logger.getName(), logger.getLevel() ); logger.setLevel( level ); } } }  }
JobEntryUtils { public static void attachAppenderTo( Appender appender, LogLevel logLevel, Map<String, Level> logLevelCache, String... logNames ) { for ( String logName : logNames ) { Logger logger = findLogger( logName ); logger.addAppender( appender ); Level level = org.pentaho.di.core.logging.KettleLogChannelAppender.LOG_LEVEL_MAP.get( logLevel ); if ( level != null ) { logLevelCache.put( logger.getName(), logger.getLevel() ); logger.setLevel( level ); } } }  static Logger findLogger( String logName ); static void attachAppenderTo( Appender appender, LogLevel logLevel, Map<String, Level> logLevelCache,
      String... logNames ); static void removeAppenderFrom( Appender appender, Map<String, Level> logLevelCache, String... logNames ); static boolean asBoolean( String s, VariableSpace variableSpace ); static Long asLong( String s, VariableSpace variableSpace ); }
JobEntryUtils { public static void attachAppenderTo( Appender appender, LogLevel logLevel, Map<String, Level> logLevelCache, String... logNames ) { for ( String logName : logNames ) { Logger logger = findLogger( logName ); logger.addAppender( appender ); Level level = org.pentaho.di.core.logging.KettleLogChannelAppender.LOG_LEVEL_MAP.get( logLevel ); if ( level != null ) { logLevelCache.put( logger.getName(), logger.getLevel() ); logger.setLevel( level ); } } }  static Logger findLogger( String logName ); static void attachAppenderTo( Appender appender, LogLevel logLevel, Map<String, Level> logLevelCache,
      String... logNames ); static void removeAppenderFrom( Appender appender, Map<String, Level> logLevelCache, String... logNames ); static boolean asBoolean( String s, VariableSpace variableSpace ); static Long asLong( String s, VariableSpace variableSpace );  }