avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Mortenson <l...@silveregg.co.jp>
Subject Re: About ExcaliburComponentManager and LogKitManager
Date Thu, 07 Feb 2002 03:40:57 GMT
Berin Loritsch wrote:

> jean-pierre lerbscher wrote:
>
>> Hi,
>> It seems that these classes (ExcaliburComponentManager,
>> AbstractLoggable,... ) depends on org.apache.log.Logger class and
>> org.apache.avalon.excalibur.logger.LogKitManager deprecated interface.
>> Could you do something for the next release ?
>> Thanks
>> JPL
>
>
>
> These are freshly deprecated interfaces, let's give other projects that
> use Excalibur time to migrate first.  You'd be surprised how long this
> actually takes. 

It looks like the LogKitManager was replaced by LoggerManager, but what 
was ExcaliburComponentManager replaced by?  Could you explain how things 
should be done now?

We use code like the following, but it uses the deprecated methods:
----
        // Create a context to use.
        DefaultContext context = new DefaultContext();
        // Add any context variables here.
        context.makeReadOnly();
       
        // Create a ConfigurationBuilder to parse the config files.
        DefaultConfigurationBuilder builder = new 
DefaultConfigurationBuilder();
       
        // Load in the configuration files
        Configuration logKitConfig     = loadConfiguration( builder, 
"../conf/logkit.xml" );
        Configuration rolesConfig      = loadConfiguration( builder, 
"../conf/roles.xml" );
        Configuration componentsConfig = loadConfiguration( builder, 
"../conf/components.xml" );
       
        // Setup the LogKitManager
        DefaultLogKitManager logManager = new DefaultLogKitManager();
        Logger lmLogger = Hierarchy.getDefaultHierarchy().
            getLoggerFor( logKitConfig.getAttribute( "logger", "INFO" ) );
        lmLogger.setPriority(
            Priority.getPriorityForName( logKitConfig.getAttribute( 
"log-level", "INFO" ) ) );
        logManager.setLogger( lmLogger );
        logManager.configure( logKitConfig );

        /*
        // New stuff that replaces DefaultLogKitManager ????. 
        LogKitLoggerManager logManager = new 
LogKitLoggerManager(Hierarchy.getDefaultHierarchy());
        logManager.contextualize(context);
        logManager.configure(componentsConfig);
        */
       
        // Setup the RoleManager
        DefaultRoleManager roleManager = new DefaultRoleManager();
        roleManager.setLogger(
            logManager.getLogger( rolesConfig.getAttribute( "logger", 
"INFO" ) ) );
        roleManager.configure( rolesConfig );
       
        // Set up the ComponentManager
        ExcaliburComponentManager manager = new ExcaliburComponentManager();
        manager.setLogger(
            logManager.getLogger( componentsConfig.getAttribute( 
"logger", "INFO" ) ) );
        manager.setLogKitManager( logManager );
        manager.contextualize( context );
        manager.setRoleManager( roleManager );
        manager.configure( componentsConfig );
        manager.initialize();
       
        // Use manager to lookup components....
---

I put in the code to upgrade to LoggerManager, but where do I go from there?

Thanks,
Leif




>
>
>
>



--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message