avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: avalon-phoenix/src/test/org/apache/avalon/phoenix/components/logger/test LogManagerTestCase.java
Date Sat, 31 May 2003 00:19:09 GMT
donaldp     2003/05/30 17:19:09

  Modified:    .        build.xml
               src/java/org/apache/avalon/phoenix/components/application
                        DefaultBlockContext.java
               src/java/org/apache/avalon/phoenix/components/deployer
                        DefaultDeployer.java
               src/java/org/apache/avalon/phoenix/components/kernel
                        DefaultApplicationContext.java DefaultKernel.java
                        SarEntry.java
               src/java/org/apache/avalon/phoenix/components/kernel/beanshell
                        BeanShellKernelProxy.java
               src/java/org/apache/avalon/phoenix/components/logger
                        DefaultLogManager.java
               src/java/org/apache/avalon/phoenix/components/monitor
                        DefaultDeploymentMonitor.java
               src/java/org/apache/avalon/phoenix/interfaces
                        ApplicationContext.java Kernel.java LogManager.java
               src/test/org/apache/avalon/phoenix/components/logger/test
                        LogManagerTestCase.java
  Added:       src/java/org/apache/avalon/phoenix/components/logger
                        SimpleLoggerStore.java
                        SimpleLoggerStoreFactory.java
  Log:
  Start to break out log configuration into separate files. Also start to support configuring loggers via Log4j properties files and JDK14 logging property files.
  
  The only things remaining involve unit testing the separate files and makeing sure the property interpolation occurs in these files. Also a new release of LoggerStore that incorporates SimplerLoggerStore and renames LogKitLoggerStore to ExcaliburLoggerStore should be made.
  
  Based on work done by Mauro Talevi <mauro.talevi@aquilonia.org>
  
  PR: PNIX-9
  
  Revision  Changes    Path
  1.250     +46 -3     avalon-phoenix/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/build.xml,v
  retrieving revision 1.249
  retrieving revision 1.250
  diff -u -r1.249 -r1.250
  --- build.xml	29 May 2003 05:24:11 -0000	1.249
  +++ build.xml	31 May 2003 00:19:08 -0000	1.250
  @@ -109,6 +109,10 @@
       <property name="configkit.jar" value="${repo.dir}/spice-configkit/spice-configkit-1.1.2/spice-configkit-1.1.2.jar"/>
       <fileset id="configkit.fileset" dir="${lib.dir}" includes="repo/spice-configkit/spice-configkit-1.1.2/lib/*.jar"/>
   
  +    <!-- Invoke ant get-loggerstore' to get these -->
  +    <property name="loggerstore.jar" value="${repo.dir}/spice-loggerstore/spice-loggerstore-0.5/spice-loggerstore-0.5.jar"/>
  +    <fileset id="loggerstore.fileset" dir="${lib.dir}" includes="repo/spice-loggerstore/spice-loggerstore-0.5/lib/*.jar"/>
  +
       <!-- Invoke ant get-classman' to get these -->
       <property name="classman.jar" value="${repo.dir}/spice-classman/spice-classman-1.0/spice-classman-1.0.jar"/>
       <fileset id="classman.fileset" dir="${lib.dir}" includes="repo/spice-classman/spice-classman-1.0/lib/*.jar"/>
  @@ -121,6 +125,7 @@
           <pathelement path="${log4j.jar}"/>
           <pathelement path="${cli.jar}"/>
           <pathelement path="${configkit.jar}"/>
  +        <pathelement path="${loggerstore.jar}"/>
           <pathelement path="${classman.jar}"/>
           <pathelement path="${mx4j.jar}"/>
           <pathelement path="${mx4j-tools.jar}"/>
  @@ -145,6 +150,7 @@
           <pathelement location="${junit.jar}"/>
           <path refid="project.class.path"/>
           <fileset refid="configkit.fileset"/>
  +        <fileset refid="loggerstore.fileset"/>
       </path>
   
       <!-- =================================================================== -->
  @@ -471,6 +477,37 @@
       </target>
   
       <!-- =================================================================== -->
  +    <!-- LoggerStore Tasks.                                                    -->
  +    <!-- =================================================================== -->
  +    <target name="check-loggerstore-init" depends="init">
  +        <available property="loggerstore.present" classname="org.realityforge.loggerstore.LoggerStore">
  +            <classpath refid="project.class.path"/>
  +        </available>
  +    </target>
  +
  +    <target name="check-loggerstore" depends="check-loggerstore-init" unless="loggerstore.present">
  +        <echo>**********************************</echo>
  +        <echo>* Please execute target          *</echo>
  +        <echo>* 'get-loggerstore' in the main  *</echo>
  +        <echo>* build.xml build file           *</echo>
  +        <echo>* to download one and            *</echo>
  +        <echo>* a half Mb of Spice LoggerStore *</echo>
  +        <echo>**********************************</echo>
  +        <fail message="Spice LoggerStore needed. See above."/>
  +    </target>
  +
  +    <!-- Get the jars from the loggerstore project. -->
  +    <target name="get-loggerstore" description="Get the Spice LoggerStore distribution from SourceForge.">
  +        <mkdir dir="${repo.dir}/spice-loggerstore"/>
  +        <get src="http://osdn.dl.sourceforge.net/sourceforge/spice/spice-loggerstore-0.5.tar.gz"
  +            dest="${repo.dir}/spice-loggerstore/spice-loggerstore.tar.gz"
  +            verbose="true"
  +            usetimestamp="true"/>
  +        <gunzip src="${repo.dir}/spice-loggerstore/spice-loggerstore.tar.gz" dest="${repo.dir}/spice-loggerstore"/>
  +        <untar src="${repo.dir}/spice-loggerstore/spice-loggerstore.tar" dest="${repo.dir}/spice-loggerstore"/>
  +    </target>
  +
  +    <!-- =================================================================== -->
       <!-- ClassMan Tasks.                                                     -->
       <!-- =================================================================== -->
       <target name="check-classman-init" depends="init">
  @@ -490,7 +527,7 @@
           <fail message="Spice ClassMan needed. See above."/>
       </target>
   
  -    <!-- Get the jars from the configkit project. -->
  +    <!-- Get the jars from the ClassMan project. -->
       <target name="get-classman" description="Get the Spice ClassMan distribution from SourceForge.">
           <mkdir dir="${repo.dir}/spice-classman"/>
           <get src="http://osdn.dl.sourceforge.net/sourceforge/spice/spice-classman-1.0.tar.gz"
  @@ -521,7 +558,9 @@
   
   
       <!-- Check requirements of environment -->
  -    <target name="check-environment" depends="check-mx4j, check-log4j, check-cli, check-configkit, check-classman, check-wrapper">
  +    <target name="check-environment"
  +        depends="check-mx4j, check-log4j, check-cli, check-loggerstore,
  +                 check-configkit, check-classman, check-wrapper">
           <available property="xerces.present" type="file" file="${xerces.jar}"/>
           <available property="servlet.present" classname="javax.servlet.Servlet">
               <classpath refid="project.class.path"/>
  @@ -844,6 +883,10 @@
           <copy todir="${bin.dist.tools.lib}" flatten="true">
               <fileset refid="configkit.fileset"/>
           </copy>
  +        <copy file="${loggerstore.jar}" todir="${bin.dist.container.lib}"/>
  +        <copy todir="${bin.dist.container.lib}" flatten="true">
  +            <fileset refid="loggerstore.fileset"/>
  +        </copy>
           <copy todir="${bin.dist.container.lib}">
               <fileset dir="${lib.dir}/container">
                   <include name="*.jar"/>
  @@ -1291,7 +1334,7 @@
       </target>
   
       <target name="get-all-dependencies"
  -        depends="get-mx4j,get-log4j,get-cli,get-configkit,get-classman,get-wrapper"
  +        depends="get-mx4j,get-log4j,get-cli,get-loggerstore,get-configkit,get-classman,get-wrapper"
           description="Meta-task to get all optional libaries"/>
   
       &forrest-targets;
  
  
  
  1.26      +10 -2     avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DefaultBlockContext.java
  
  Index: DefaultBlockContext.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/DefaultBlockContext.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DefaultBlockContext.java	22 Mar 2003 12:07:07 -0000	1.25
  +++ DefaultBlockContext.java	31 May 2003 00:19:08 -0000	1.26
  @@ -47,7 +47,6 @@
    Apache Software Foundation, please see <http://www.apache.org/>.
   
   */
  -
   package org.apache.avalon.phoenix.components.application;
   
   import java.io.File;
  @@ -128,7 +127,16 @@
   
       public Logger getLogger( final String name )
       {
  -        return m_applicationContext.getLogger( getName() ).getChildLogger( name );
  +        try
  +        {
  +            return m_applicationContext.getLogger( getName() ).getChildLogger( name );
  +        }
  +        catch( Exception e )
  +        {
  +            final String message =
  +                "Unable to aquire logger " + name + " due to " + e;
  +            throw new IllegalStateException( message );
  +        }
       }
   
       public ClassLoader getClassLoader( final String name )
  
  
  
  1.86      +5 -12     avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/DefaultDeployer.java
  
  Index: DefaultDeployer.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/DefaultDeployer.java,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- DefaultDeployer.java	30 Apr 2003 10:16:48 -0000	1.85
  +++ DefaultDeployer.java	31 May 2003 00:19:08 -0000	1.86
  @@ -64,9 +64,7 @@
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
  -import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
  @@ -88,6 +86,7 @@
   import org.apache.avalon.phoenix.interfaces.LogManager;
   import org.apache.avalon.phoenix.tools.configuration.ConfigurationBuilder;
   import org.apache.avalon.phoenix.tools.verifier.SarVerifier;
  +import org.realityforge.loggerstore.LoggerStore;
   import org.xml.sax.InputSource;
   
   /**
  @@ -321,17 +320,13 @@
               data.put( BlockContext.APP_NAME, name );
               data.put( BlockContext.APP_HOME_DIR, homeDirectory );
   
  -            final DefaultContext context = new DefaultContext();
  -            context.put( BlockContext.APP_NAME, name );
  -            context.put( BlockContext.APP_HOME_DIR, homeDirectory );
  -
  -            final Configuration logs = environment.getChild( "logs" );
  +            final Configuration logs = environment.getChild( "logs", false );
               //Load hierarchy before classloader placed in context as
               //that way the logFactory will not try to use the application
               //specific classloader to load the targets which will cause
               //CastClassExceptions
  -            final Logger logger =
  -                m_logManager.createHierarchy( logs, context );
  +            final LoggerStore store =
  +                m_logManager.createHierarchy( logs, homeDirectory, workDirectory, data );
   
               final ClassLoaderSet classLoaderSet =
                   m_classLoaderManager.createClassLoaderSet( environment,
  @@ -340,8 +335,6 @@
                                                              workDirectory );
               final ClassLoader classLoader = classLoaderSet.getDefaultClassLoader();
   
  -            context.put( "classloader", classLoader );
  -
               final Configuration newConfig = processConfiguration( name, config );
   
               final Map parameters = new HashMap();
  @@ -365,7 +358,7 @@
                                        homeDirectory,
                                        workDirectory,
                                        classLoader,
  -                                     logger,
  +                                     store,
                                        classLoaderSet.getClassLoaders() );
   
               m_installations.put( name, installation );
  
  
  
  1.43      +8 -6      avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultApplicationContext.java
  
  Index: DefaultApplicationContext.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultApplicationContext.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- DefaultApplicationContext.java	11 Apr 2003 01:06:58 -0000	1.42
  +++ DefaultApplicationContext.java	31 May 2003 00:19:08 -0000	1.43
  @@ -71,6 +71,7 @@
   import org.apache.avalon.phoenix.interfaces.ManagerException;
   import org.apache.avalon.phoenix.interfaces.SystemManager;
   import org.apache.excalibur.instrument.InstrumentManager;
  +import org.realityforge.loggerstore.LoggerStore;
   
   /**
    * Manage the "frame" in which Applications operate.
  @@ -86,7 +87,7 @@
           ResourceManager.getPackageResources( DefaultApplicationContext.class );
   
       //Log Hierarchy for application
  -    private final Logger m_hierarchy;
  +    private final LoggerStore m_store;
   
       ///ClassLoader for application
       private final ClassLoader m_classLoader;
  @@ -117,7 +118,7 @@
                                            final File homeDirectory,
                                            final File workDirectory,
                                            final ClassLoader classLoader,
  -                                         final Logger hierarchy,
  +                                         final LoggerStore store,
                                            final Map loaders )
       {
           if( null == profile )
  @@ -128,9 +129,9 @@
           {
               throw new NullPointerException( "classLoader" );
           }
  -        if( null == hierarchy )
  +        if( null == store )
           {
  -            throw new NullPointerException( "hierarchy" );
  +            throw new NullPointerException( "store" );
           }
           if( null == workDirectory )
           {
  @@ -142,7 +143,7 @@
           }
           m_profile = profile;
           m_classLoader = classLoader;
  -        m_hierarchy = hierarchy;
  +        m_store = store;
           m_workDirectory = workDirectory;
           m_homeDirectory = homeDirectory;
           m_loaders = loaders;
  @@ -247,8 +248,9 @@
        * @return the Logger
        */
       public Logger getLogger( final String category )
  +        throws Exception
       {
  -        return m_hierarchy.getChildLogger( category );
  +        return m_store.getLogger( category );
       }
   
       /**
  
  
  
  1.91      +4 -3      avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/DefaultKernel.java,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- DefaultKernel.java	17 Apr 2003 02:11:47 -0000	1.90
  +++ DefaultKernel.java	31 May 2003 00:19:08 -0000	1.91
  @@ -79,6 +79,7 @@
   import org.apache.avalon.phoenix.interfaces.KernelMBean;
   import org.apache.avalon.phoenix.interfaces.SystemManager;
   import org.apache.excalibur.instrument.InstrumentManager;
  +import org.realityforge.loggerstore.LoggerStore;
   
   /**
    * The ServerKernel is the core of the Phoenix system.
  @@ -358,7 +359,7 @@
                                   final File homeDirectory,
                                   final File workDirectory,
                                   final ClassLoader classLoader,
  -                                final Logger logger,
  +                                final LoggerStore store,
                                   final Map classloaders )
           throws Exception
       {
  @@ -367,7 +368,7 @@
           final SarEntry entry =
               new SarEntry( profile, homeDirectory,
                             workDirectory, classLoader,
  -                          logger, classloaders );
  +                          store, classloaders );
           m_entries.put( name, entry );
   
           try
  @@ -392,7 +393,7 @@
                                              entry.getHomeDirectory(),
                                              entry.getWorkDirectory(),
                                              entry.getClassLoader(),
  -                                           entry.getLogger(),
  +                                           entry.getLoggerStore(),
                                              entry.getClassLoaders() );
   
           ContainerUtil.enableLogging( context, createContextLogger( name ) );
  
  
  
  1.23      +8 -8      avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/SarEntry.java
  
  Index: SarEntry.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/SarEntry.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- SarEntry.java	22 Mar 2003 12:07:10 -0000	1.22
  +++ SarEntry.java	31 May 2003 00:19:08 -0000	1.23
  @@ -52,9 +52,9 @@
   
   import java.io.File;
   import java.util.Map;
  -import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.phoenix.containerkit.profile.PartitionProfile;
   import org.apache.avalon.phoenix.interfaces.Application;
  +import org.realityforge.loggerstore.LoggerStore;
   
   /**
    * This is the structure describing each server application before it is loaded.
  @@ -65,7 +65,7 @@
   {
       private final PartitionProfile m_profile;
       private final ClassLoader m_classLoader;
  -    private final Logger m_logger;
  +    private final LoggerStore m_store;
       private final File m_homeDirectory;
       private final File m_workDirectory;
       private final Map m_classLoaders;
  @@ -75,7 +75,7 @@
                           final File homeDirectory,
                           final File workDirectory,
                           final ClassLoader classLoader,
  -                        final Logger logger,
  +                        final LoggerStore store,
                           final Map classLoaders )
       {
           if( null == profile )
  @@ -86,9 +86,9 @@
           {
               throw new NullPointerException( "classLoader" );
           }
  -        if( null == logger )
  +        if( null == store )
           {
  -            throw new NullPointerException( "logger" );
  +            throw new NullPointerException( "store" );
           }
           if( null == workDirectory )
           {
  @@ -105,7 +105,7 @@
   
           m_profile = profile;
           m_classLoader = classLoader;
  -        m_logger = logger;
  +        m_store = store;
           m_homeDirectory = homeDirectory;
           m_workDirectory = workDirectory;
           m_classLoaders = classLoaders;
  @@ -136,9 +136,9 @@
           return m_profile;
       }
   
  -    public Logger getLogger()
  +    public LoggerStore getLoggerStore()
       {
  -        return m_logger;
  +        return m_store;
       }
   
       public ClassLoader getClassLoader()
  
  
  
  1.15      +2 -2      avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/beanshell/BeanShellKernelProxy.java
  
  Index: BeanShellKernelProxy.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/kernel/beanshell/BeanShellKernelProxy.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- BeanShellKernelProxy.java	18 May 2003 23:02:57 -0000	1.14
  +++ BeanShellKernelProxy.java	31 May 2003 00:19:08 -0000	1.15
  @@ -52,10 +52,10 @@
   
   import java.io.File;
   import java.util.Map;
  -import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.phoenix.containerkit.profile.PartitionProfile;
   import org.apache.avalon.phoenix.interfaces.Application;
   import org.apache.avalon.phoenix.interfaces.Kernel;
  +import org.realityforge.loggerstore.LoggerStore;
   
   /**
    * @author Paul Hammant
  @@ -77,7 +77,7 @@
       public void addApplication( final PartitionProfile profile,
                                   final File homeDirectory, final File workDirectory,
                                   final ClassLoader classLoader,
  -                                final Logger logger,
  +                                final LoggerStore store,
                                   final Map classloaders )
           throws Exception
       {
  
  
  
  1.35      +183 -82   avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/DefaultLogManager.java
  
  Index: DefaultLogManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/DefaultLogManager.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- DefaultLogManager.java	5 Apr 2003 04:25:42 -0000	1.34
  +++ DefaultLogManager.java	31 May 2003 00:19:09 -0000	1.35
  @@ -51,12 +51,13 @@
   package org.apache.avalon.phoenix.components.logger;
   
   import java.io.File;
  +import java.util.HashMap;
  +import java.util.Map;
  +import java.util.Properties;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.excalibur.logger.LogKitLoggerManager;
  -import org.apache.avalon.excalibur.logger.LoggerManager;
  -import org.apache.avalon.excalibur.logger.SimpleLogKitManager;
   import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.ConfigurationUtil;
   import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
  @@ -65,7 +66,24 @@
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.phoenix.BlockContext;
  +import org.apache.avalon.phoenix.components.util.ResourceUtil;
   import org.apache.avalon.phoenix.interfaces.LogManager;
  +import org.realityforge.loggerstore.DOMLog4JLoggerStoreFactory;
  +import org.realityforge.loggerstore.InitialLoggerStoreFactory;
  +import org.realityforge.loggerstore.Jdk14LoggerStoreFactory;
  +import org.realityforge.loggerstore.LogKitLoggerStoreFactory;
  +import org.realityforge.loggerstore.LoggerStore;
  +import org.realityforge.loggerstore.LoggerStoreFactory;
  +import org.realityforge.loggerstore.PropertyLog4JLoggerStoreFactory;
  +import org.realityforge.configkit.PropertyExpander;
  +import org.realityforge.configkit.ResolverFactory;
  +import org.w3c.dom.Element;
  +import org.w3c.dom.Document;
  +import org.w3c.dom.NodeList;
  +import org.w3c.dom.Node;
  +import org.xml.sax.EntityResolver;
  +import javax.xml.parsers.DocumentBuilder;
  +import javax.xml.parsers.DocumentBuilderFactory;
   
   /**
    * Interface that is used to manage Log objects for a Sar.
  @@ -79,20 +97,9 @@
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultLogManager.class );
   
  -    /**
  -     * Constant used to define LogManager class to use original log format.
  -     */
  -    private static final String VERSION_1 = SimpleLogKitManager.class.getName();
  -
  -    /**
  -     * Constant used to define LogManager class to use excaliburs log format.
  -     */
  -    private static final String VERSION_1_1 = LogKitLoggerManager.class.getName();
  +    private final PropertyExpander m_expander = new PropertyExpander();
   
  -    /**
  -     * Constant used to define LogManager class to use log4j log format and system.
  -     */
  -    private static final String VERSION_LOG4J = ExtendedLog4jLoggerManager.class.getName();
  +    private final InitialLoggerStoreFactory m_factory = new InitialLoggerStoreFactory();
   
       /**
        * Hold the value of phoenix.home
  @@ -104,14 +111,12 @@
           m_phoenixHome = (File)context.get( "phoenix.home" );
       }
   
  -    private Context createLoggerManagerContext( final Context appContext )
  +    private Map createLoggerManagerContext( final Map appContext )
       {
  -        final DefaultContext context = new DefaultContext( appContext );
  -
  -        context.put( "phoenix.home", m_phoenixHome );
  -        context.makeReadOnly();
  -
  -        return context;
  +        final HashMap data = new HashMap();
  +        data.putAll( appContext );
  +        data.put( "phoenix.home", m_phoenixHome );
  +        return data;
       }
   
       /**
  @@ -122,76 +127,172 @@
        * @return the Log hierarchy
        * @throws Exception if unable to create Loggers
        */
  -    public Logger createHierarchy( final Configuration logs,
  -                                   final Context context )
  +    public LoggerStore createHierarchy( final Configuration logs,
  +                                        final File homeDirectory,
  +                                        final File workDirectory,
  +                                        final Map context )
           throws Exception
       {
  -        final String version = logs.getAttribute( "version", "1.0" );
  -        if( getLogger().isDebugEnabled() )
  +        final Map map = createLoggerManagerContext( context );
  +        if( null == logs )
  +        {
  +            LoggerStore store = null;
  +            store = scanForLoggerConfig( "SAR-INF/log4j.properties",
  +                                         PropertyLog4JLoggerStoreFactory.class.getName(),
  +                                         homeDirectory,
  +                                         workDirectory,
  +                                         map );
  +            if( null != store )
  +            {
  +                return store;
  +            }
  +            store = scanForLoggerConfig( "SAR-INF/log4j.xml",
  +                                         DOMLog4JLoggerStoreFactory.class.getName(),
  +                                         homeDirectory,
  +                                         workDirectory,
  +                                         map );
  +            if( null != store )
  +            {
  +                return store;
  +            }
  +            store = scanForLoggerConfig( "SAR-INF/logging.properties",
  +                                         Jdk14LoggerStoreFactory.class.getName(),
  +                                         homeDirectory,
  +                                         workDirectory,
  +                                         map );
  +            if( null != store )
  +            {
  +                return store;
  +            }
  +            store = scanForLoggerConfig( "SAR-INF/excalibur-logger.xml",
  +                                         LogKitLoggerStoreFactory.class.getName(),
  +                                         homeDirectory,
  +                                         workDirectory,
  +                                         map );
  +            if( null != store )
  +            {
  +                return store;
  +            }
  +
  +            //TODO: Set up a default LoggerStore at this point
  +            final String message = "Unable to locate any logging configuration";
  +            throw new IllegalStateException( message );
  +        }
  +        else
           {
  -            final String message =
  -                REZ.getString( "logger-create",
  -                               context.get( BlockContext.APP_NAME ),
  -                               version );
  -            getLogger().debug( message );
  +            final String version = logs.getAttribute( "version", "1.0" );
  +            if( getLogger().isDebugEnabled() )
  +            {
  +                final String message =
  +                    REZ.getString( "logger-create",
  +                                   context.get( BlockContext.APP_NAME ),
  +                                   version );
  +                getLogger().debug( message );
  +            }
  +
  +            if( version.equals( "1.0" ) )
  +            {
  +                final LoggerStoreFactory loggerManager = new SimpleLoggerStoreFactory();
  +                ContainerUtil.enableLogging( loggerManager, getLogger() );
  +                final HashMap config = new HashMap();
  +                config.put( Logger.class.getName(), getLogger() );
  +                config.put( Context.class.getName(), new DefaultContext( map ) );
  +                config.put( Configuration.class.getName(), logs );
  +                return loggerManager.createLoggerStore( config );
  +            }
  +            else if( version.equals( "1.1" ) )
  +            {
  +                final LoggerStoreFactory loggerManager = new LogKitLoggerStoreFactory();
  +                ContainerUtil.enableLogging( loggerManager, getLogger() );
  +                final HashMap config = new HashMap();
  +                config.put( Logger.class.getName(), getLogger() );
  +                config.put( Context.class.getName(), new DefaultContext( map ) );
  +                config.put( Configuration.class.getName(), logs );
  +                return loggerManager.createLoggerStore( config );
  +            }
  +            else if( version.equals( "log4j" ) )
  +            {
  +                final LoggerStoreFactory loggerManager = new DOMLog4JLoggerStoreFactory();
  +                ContainerUtil.enableLogging( loggerManager, getLogger() );
  +                final HashMap config = new HashMap();
  +                final Element element = buildLog4JConfiguration( logs );
  +                m_expander.expandValues( element, map );
  +                config.put( Element.class.getName(), element );
  +                return loggerManager.createLoggerStore( config );
  +            }
  +            else
  +            {
  +                final String message =
  +                    "Unknown logger version '" + version + "' in environment.xml";
  +                throw new IllegalStateException( message );
  +            }
           }
  -        final LoggerManager loggerManager = createLoggerManager( version );
  -        ContainerUtil.enableLogging( loggerManager, getLogger() );
  -        ContainerUtil.contextualize( loggerManager, createLoggerManagerContext( context ) );
  -        ContainerUtil.configure( loggerManager, logs );
  -        ContainerUtil.initialize( loggerManager );
  -        return loggerManager.getDefaultLogger();
       }
   
  -    /**
  -     * Create a {@link LoggerManager} for specified version string.
  -     *
  -     * @param version the version string
  -     * @return the created {@link LoggerManager}
  -     */
  -    private LoggerManager createLoggerManager( final String version )
  +    private Element buildLog4JConfiguration( final Configuration logs )
       {
  -        final String classname = getClassname( version );
  -        try
  -        {
  -            final ClassLoader classLoader = getClass().getClassLoader();
  -            final Class clazz = classLoader.loadClass( classname );
  -            return (LoggerManager)clazz.newInstance();
  -        }
  -        catch( final Exception e )
  -        {
  -            final String message =
  -                REZ.getString( "no-create-manager", version, e );
  -            throw new IllegalArgumentException( message );
  +        final Element element = ConfigurationUtil.toElement( logs );
  +        final Document document = element.getOwnerDocument();
  +        final Element newElement = document.createElement( "log4j:configuration" );
  +        final NodeList childNodes = element.getChildNodes();
  +        final int length = childNodes.getLength();
  +        for( int i = 0; i < length; i++ )
  +        {
  +            final Node node = childNodes.item( i );
  +            final Node newNode = node.cloneNode( true );
  +            newElement.appendChild( newNode );
           }
  +
  +        document.appendChild( newElement );
  +        return newElement;
       }
   
  -    /**
  -     * Get the classname of {@link LoggerManager} that coresponds
  -     * to specified version.
  -     *
  -     * @param version the version string
  -     * @return the classname of {@link LoggerManager}
  -     */
  -    private String getClassname( final String version )
  +    private LoggerStore scanForLoggerConfig( final String location,
  +                                             final String classname,
  +                                             final File homeDirectory,
  +                                             final File workDirectory,
  +                                             final Map context )
  +        throws Exception
       {
  -        if( version.equals( "1.0" ) )
  -        {
  -            return VERSION_1;
  -        }
  -        else if( version.equals( "1.1" ) )
  -        {
  -            return VERSION_1_1;
  -        }
  -        else if( version.equals( "log4j" ) )
  -        {
  -            return VERSION_LOG4J;
  -        }
  -        else
  -        {
  -            final String message =
  -                REZ.getString( "unknown-version", version );
  -            throw new IllegalArgumentException( message );
  +        final boolean isPropertiesFile = location.endsWith( "properties" );
  +        final File file =
  +            ResourceUtil.getFileForResource( location,
  +                                             homeDirectory,
  +                                             workDirectory );
  +        LoggerStore store = null;
  +        if( null != file )
  +        {
  +            final HashMap config = new HashMap();
  +            if( isPropertiesFile )
  +            {
  +                final Properties properties = new Properties();
  +                properties.load( file.toURL().openStream() );
  +                final Properties newProperties =
  +                    m_expander.expandValues( properties, context );
  +                config.put( Properties.class.getName(), newProperties );
  +            }
  +            //TODO: Remove next line as it is an ugly hack!
  +            else if( !location.equals( "SAR-INF/excalibur-logger.xml" ) )
  +            {
  +                final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  +                final DocumentBuilder builder = factory.newDocumentBuilder();
  +
  +                //TODO: Need to set up config files for entity resolver
  +                final EntityResolver resolver =
  +                    ResolverFactory.createResolver( getClass().getClassLoader() );
  +                builder.setEntityResolver( resolver );
  +                final Document document = builder.parse( file );
  +                final Element element = document.getDocumentElement();
  +                m_expander.expandValues( element, context );
  +                config.put( Element.class.getName(), element );
  +            }
  +            else
  +            {
  +                config.put( LoggerStoreFactory.URL_LOCATION, file.toURL() );
  +            }
  +            config.put( InitialLoggerStoreFactory.INITIAL_FACTORY, classname );
  +            store = m_factory.createLoggerStore( config );
           }
  +        return store;
       }
   }
  
  
  
  1.1                  avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/SimpleLoggerStore.java
  
  Index: SimpleLoggerStore.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1997-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Avalon", "Phoenix" and "Apache Software Foundation"
      must  not be  used to  endorse or  promote products derived  from this
      software without prior written permission. For written permission, please
      contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.avalon.phoenix.components.logger;
  
  import org.apache.avalon.excalibur.logger.LoggerManager;
  import org.apache.avalon.excalibur.logger.SimpleLogKitManager;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.container.ContainerUtil;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.DefaultContext;
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.logger.NullLogger;
  import org.realityforge.loggerstore.AbstractLoggerStore;
  
  /**
   * <p>LogKitLoggerStore extends AbstractLoggerStore to provide the implementation
   * specific to the LogKit logger. </p>
   *
   * @author <a href="mailto:mauro.talevi at aquilonia.org">Mauro Talevi</a>
   */
  class SimpleLoggerStore
      extends AbstractLoggerStore
  {
      /** The Logger Manager */
      private LoggerManager m_loggerManager;
  
      /**
       * Creates a <code>LogKitLoggerStore</code> using the configuration configuration
       *
       * @param configuration the logger configuration
       * @throws Exception if fails to create or configure Logger
       */
      public SimpleLoggerStore( final Logger logger,
                                final Context context,
                                final Configuration configuration )
          throws Exception
      {
          m_loggerManager = new SimpleLogKitManager();
          if( null != logger )
          {
              ContainerUtil.enableLogging( m_loggerManager, logger );
          }
          else
          {
              ContainerUtil.enableLogging( m_loggerManager, new NullLogger() );
          }
          if( null != context )
          {
              ContainerUtil.contextualize( m_loggerManager, context );
          }
          else
          {
              ContainerUtil.contextualize( m_loggerManager, new DefaultContext() );
          }
          ContainerUtil.configure( m_loggerManager, configuration );
          setRootLogger( m_loggerManager.getDefaultLogger() );
      }
  
      /**
       *  Creates new LogKitLogger for the given category.
       */
      protected Logger createLogger( final String name )
      {
          return m_loggerManager.getLoggerForCategory( name );
      }
  
      /**
       *  Closes the LoggerStore and shuts down the logger hierarchy.
       */
      public void close()
      {
          try
          {
              ContainerUtil.shutdown( m_loggerManager );
          }
          catch( Exception e )
          {
          }
      }
  }
  
  
  
  1.1                  avalon-phoenix/src/java/org/apache/avalon/phoenix/components/logger/SimpleLoggerStoreFactory.java
  
  Index: SimpleLoggerStoreFactory.java
  ===================================================================
  /*
  
   ============================================================================
                     The Apache Software License, Version 1.1
   ============================================================================
  
   Copyright (C) 1997-2003 The Apache Software Foundation. All rights reserved.
  
   Redistribution and use in source and binary forms, with or without modifica-
   tion, are permitted provided that the following conditions are met:
  
   1. Redistributions of  source code must  retain the above copyright  notice,
      this list of conditions and the following disclaimer.
  
   2. Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
  
   3. The end-user documentation included with the redistribution, if any, must
      include  the following  acknowledgment:  "This product includes  software
      developed  by the  Apache Software Foundation  (http://www.apache.org/)."
      Alternately, this  acknowledgment may  appear in the software itself,  if
      and wherever such third-party acknowledgments normally appear.
  
   4. The names "Avalon", "Phoenix" and "Apache Software Foundation"
      must  not be  used to  endorse or  promote products derived  from this
      software without prior written permission. For written permission, please
      contact apache@apache.org.
  
   5. Products  derived from this software may not  be called "Apache", nor may
      "Apache" appear  in their name,  without prior written permission  of the
      Apache Software Foundation.
  
   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
   This software  consists of voluntary contributions made  by many individuals
   on  behalf of the Apache Software  Foundation. For more  information on the
   Apache Software Foundation, please see <http://www.apache.org/>.
  
  */
  package org.apache.avalon.phoenix.components.logger;
  
  import java.util.Map;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.Logger;
  import org.realityforge.loggerstore.AbstractLoggerStoreFactory;
  import org.realityforge.loggerstore.LoggerStore;
  
  /**
   * LogKitLoggerStoreFactory is an implementation of LoggerStoreFactory
   * for the LogKit Logger.
   *
   * @author <a href="mailto:mauro.talevi at aquilonia.org">Mauro Talevi</a>
   * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2003/05/31 00:19:09 $
   */
  public class SimpleLoggerStoreFactory
      extends AbstractLoggerStoreFactory
  {
      /**
       * Creates a LoggerStore from a given set of configuration parameters.
       *
       * @param config the Map of parameters for the configuration of the store
       * @return the LoggerStore
       * @throws Exception if unable to create the LoggerStore
       */
      protected LoggerStore doCreateLoggerStore( final Map config )
          throws Exception
      {
          Logger logger =
              (Logger)config.get( Logger.class.getName() );
          if( null == logger )
          {
              logger = getLogger();
          }
          final Context context =
              (Context)config.get( Context.class.getName() );
  
          /*
          final Element element = (Element)config.get( Element.class.getName() );
          if( null != element )
          {
              return new LogKitLoggerStore( ConfigurationUtil.toConfiguration( element ) );
          }
          */
          final Configuration configuration =
              (Configuration)config.get( Configuration.class.getName() );
          if( null != configuration )
          {
              return new SimpleLoggerStore( logger, context, configuration );
          }
  
          return missingConfiguration();
      }
  }
  
  
  
  1.8       +13 -13    avalon-phoenix/src/java/org/apache/avalon/phoenix/components/monitor/DefaultDeploymentMonitor.java
  
  Index: DefaultDeploymentMonitor.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/monitor/DefaultDeploymentMonitor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultDeploymentMonitor.java	30 Apr 2003 10:16:49 -0000	1.7
  +++ DefaultDeploymentMonitor.java	31 May 2003 00:19:09 -0000	1.8
  @@ -97,7 +97,7 @@
   
       /**
        * requires parameter "phoenix.apps.dir" to be set to directory
  -     * that the component is to monitor.
  +     * that the component is to scanner.
        */
       public void parameterize( final Parameters parameters )
           throws ParameterException
  @@ -108,7 +108,7 @@
       public void configure( Configuration configuration )
           throws ConfigurationException
       {
  -        m_frequency = configuration.getChild( "monitor-frequency" ).getValueAsLong( 1000L );
  +        m_frequency = configuration.getChild( "scanner-frequency" ).getValueAsLong( 1000L );
       }
   
       /**
  @@ -121,7 +121,7 @@
       }
   
       /**
  -     * Start the monitor.
  +     * Start the scanner.
        */
       public void start()
           throws Exception
  @@ -136,7 +136,7 @@
       }
   
       /**
  -     * Stop the monitor.
  +     * Stop the scanner.
        */
       public void stop()
           throws Exception
  @@ -145,7 +145,7 @@
       }
   
       /**
  -     * This method is called when the monitor detects that the contents
  +     * This method is called when the scanner detects that the contents
        * of deployment directory has changed.
        */
       public void propertyChange( final PropertyChangeEvent event )
  @@ -193,7 +193,7 @@
           try
           {
               final String message =
  -                REZ.getString( "monitor.deploy.notice",
  +                REZ.getString( "scanner.deploy.notice",
                                  name,
                                  file );
               getLogger().info( message );
  @@ -203,7 +203,7 @@
           catch( final Exception e )
           {
               final String message =
  -                REZ.getString( "monitor.no-deploy.error", file, e );
  +                REZ.getString( "scanner.no-deploy.error", file, e );
               getLogger().warn( message, e );
           }
       }
  @@ -220,7 +220,7 @@
           try
           {
               final String message =
  -                REZ.getString( "monitor.undeploy.notice",
  +                REZ.getString( "scanner.undeploy.notice",
                                  name );
               getLogger().info( message );
               m_deployer.undeploy( name );
  @@ -228,7 +228,7 @@
           catch( final Exception e )
           {
               final String message =
  -                REZ.getString( "monitor.no-undeploy.error", file, e );
  +                REZ.getString( "scanner.no-undeploy.error", file, e );
               getLogger().warn( message, e );
           }
       }
  @@ -245,7 +245,7 @@
           try
           {
               final String message =
  -                REZ.getString( "monitor.redeploy.notice",
  +                REZ.getString( "scanner.redeploy.notice",
                                  name,
                                  file );
               getLogger().info( message );
  @@ -254,7 +254,7 @@
           catch( final Exception e )
           {
               final String message =
  -                REZ.getString( "monitor.no-redeploy.error", file, e );
  +                REZ.getString( "scanner.no-redeploy.error", file, e );
               getLogger().warn( message, e );
           }
       }
  @@ -276,7 +276,7 @@
               else
               {
                   final String message =
  -                    REZ.getString( "monitor.skipping-file.notice", file );
  +                    REZ.getString( "scanner.skipping-file.notice", file );
                   getLogger().info( message );
               }
           }
  
  
  
  1.29      +2 -1      avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/ApplicationContext.java
  
  Index: ApplicationContext.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/ApplicationContext.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- ApplicationContext.java	11 Apr 2003 01:06:58 -0000	1.28
  +++ ApplicationContext.java	31 May 2003 00:19:09 -0000	1.29
  @@ -125,7 +125,8 @@
        * @param name the name of logger
        * @return the Logger
        */
  -    Logger getLogger( String name );
  +    Logger getLogger( String name )
  +        throws Exception;
   
       /**
        * Get the instrument manager to use for this application
  
  
  
  1.24      +2 -1      avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/Kernel.java
  
  Index: Kernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/Kernel.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Kernel.java	17 Apr 2003 02:11:47 -0000	1.23
  +++ Kernel.java	31 May 2003 00:19:09 -0000	1.24
  @@ -54,6 +54,7 @@
   import java.util.Map;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.phoenix.containerkit.profile.PartitionProfile;
  +import org.realityforge.loggerstore.LoggerStore;
   
   /**
    * @author <a href="mailto:peter at apache.org">Peter Donald</a>
  @@ -68,7 +69,7 @@
       void addApplication( PartitionProfile profile,
                            File homeDirectory, File workDirectory,
                            ClassLoader classLoader,
  -                         Logger logger,
  +                         LoggerStore store,
                            Map classloaders )
           throws Exception;
   
  
  
  
  1.15      +7 -3      avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/LogManager.java
  
  Index: LogManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/LogManager.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- LogManager.java	22 Mar 2003 12:07:14 -0000	1.14
  +++ LogManager.java	31 May 2003 00:19:09 -0000	1.15
  @@ -50,9 +50,10 @@
   
   package org.apache.avalon.phoenix.interfaces;
   
  +import java.io.File;
  +import java.util.Map;
   import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.logger.Logger;
  +import org.realityforge.loggerstore.LoggerStore;
   
   /**
    * Interface that is used to manage Log objects for a Sar.
  @@ -71,6 +72,9 @@
        * @return the configured Logger hierarchy
        * @throws Exception if an error occurs
        */
  -    Logger createHierarchy( Configuration logs, Context context )
  +    LoggerStore createHierarchy( Configuration logs,
  +                                 File homeDirectory,
  +                                 File workDirectory,
  +                                 Map context )
           throws Exception;
   }
  
  
  
  1.12      +10 -4     avalon-phoenix/src/test/org/apache/avalon/phoenix/components/logger/test/LogManagerTestCase.java
  
  Index: LogManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/test/org/apache/avalon/phoenix/components/logger/test/LogManagerTestCase.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- LogManagerTestCase.java	5 Apr 2003 04:25:44 -0000	1.11
  +++ LogManagerTestCase.java	31 May 2003 00:19:09 -0000	1.12
  @@ -53,12 +53,12 @@
   import java.io.File;
   import java.io.IOException;
   import java.io.InputStream;
  +import java.util.HashMap;
   import junit.framework.TestCase;
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.framework.container.ContainerUtil;
  -import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.ConsoleLogger;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.phoenix.BlockContext;
  @@ -67,6 +67,7 @@
   import org.apache.avalon.phoenix.metadata.BlockListenerMetaData;
   import org.apache.avalon.phoenix.metadata.BlockMetaData;
   import org.apache.avalon.phoenix.metadata.SarMetaData;
  +import org.realityforge.loggerstore.LoggerStore;
   
   /**
    *  An basic test case for the LogManager.
  @@ -189,12 +190,17 @@
               file.mkdirs();
           }
   
  -        final DefaultContext context = new DefaultContext();
  +        final HashMap context = new HashMap();
           context.put( BlockContext.APP_NAME, sarMetaData.getName() );
           context.put( BlockContext.APP_HOME_DIR, sarMetaData.getHomeDirectory() );
           context.put( "classloader", getClass().getClassLoader() );
   
  -        return logManager.createHierarchy( logs, context );
  +        final LoggerStore store =
  +            logManager.createHierarchy( logs,
  +                                        sarMetaData.getHomeDirectory(),
  +                                        sarMetaData.getHomeDirectory(),
  +                                        context );
  +        return store.getLogger();
       }
   
       private String getBaseDirName( final int index )
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message