1 17 package org.apache.avalon.excalibur.component; 18 19 import org.apache.avalon.excalibur.logger.LogKitManager; 20 import org.apache.avalon.excalibur.logger.LoggerManager; 21 import org.apache.avalon.framework.logger.LogKitLogger; 22 import org.apache.avalon.framework.logger.Logger; 23 24 32 public class LogkitLoggerManager 33 implements LoggerManager 34 { 35 private LoggerManager m_loggerManager; 36 private LogKitManager m_logKitManager; 37 38 public LogkitLoggerManager( final LoggerManager loggerManager, 39 final LogKitManager logKitManager ) 40 { 41 m_loggerManager = loggerManager; 42 m_logKitManager = logKitManager; 43 } 44 45 public org.apache.log.Logger getLogKitLoggerForCategory( final String categoryName ) 46 { 47 return getLogKitManager().getLogger( categoryName ); 48 } 49 50 public Logger getLoggerForCategory( String categoryName ) 51 { 52 if( null != m_loggerManager ) 53 { 54 return m_loggerManager.getLoggerForCategory( categoryName ); 55 } 56 else 57 { 58 return new LogKitLogger( getLogKitLoggerForCategory( categoryName ) ); 59 } 60 } 61 62 public Logger getDefaultLogger() 63 { 64 return getLoggerForCategory( "" ); 65 } 66 67 LogKitManager getLogKitManager() 68 { 69 if( null == m_logKitManager ) 70 { 71 m_logKitManager = new Logger2LogKitManager( m_loggerManager ); 72 } 73 return m_logKitManager; 74 } 75 } 76 | Popular Tags |