> -----Original Message-----
> From: Torsten Curdt [mailto:[EMAIL PROTECTED] 
> >> ...would you rather see people using a
> >> different logger package for future
> >> projects?

Log4J is certainly another option.

> Florida, right :)

Or perhaps the new ASF logging top level project.

> Maybe we should reconsider this for the new branch then...

I don't think there's any reason to immediately switch anything (emphasis on
immediately).  Eventually it might be a good idea.  LogKit is stable and
isn't heading to "Florida" for retirement yet, so until we have the
avalon-logging and excalibur-logging situation worked out, I wouldn't be too
hasty.  But that's me.

As for configuration of LogKit, here's a code snippet that might help (uses
the exalibur-logging package):

import org.apache.avalon.excalibur.logger.DefaultLoggerManager;
import org.apache.avalon.framework.container.ContainerUtil;
import
org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.avalon.framework.context.DefaultContext;
import org.apache.avalon.framework.service.DefaultServiceManager;

...

DefaultLoggerManager manager = new DefaultLoggerManager();
DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
Configuration c =  builder.buildFromFile("conf/logkit.xconf");
ContainerUtil.enableLogging(manager,
                            new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG));
ContainerUtil.contextualize(manager,new DefaultContext());
ContainerUtil.service(manager,new DefaultServiceManager());
ContainerUtil.configure(manager, c);
ContainerUtil.initialize(manager);
ContainerUtil.start(manager);
Logger log = manager.getDefaultLogger();


You can then configure the LogKit using the standard logkit configuration
file, like this:

<logkit logger="system.logkit" log-level="DEBUG"  
   manager-class="org.apache.avalon.excalibur.logger.LogKitLoggerManager">

    <factories>
      <factory type="file"
class="org.apache.avalon.excalibur.logger.factory.FileTargetFactory"/>
    </factories>

    <targets>
      <file id="logFile">
         <filename>my_log.log</filename>
         <append>true</append>
      </file>
    </targets>

    <categories>
      <category name="" log-level="DEBUG">
        <log-target id-ref="logFile"/>
      </category>
    </categories>
</logkit>



J. Aaron Farr
  SONY ELECTRONICS
  DDP-CIM
  (724) 696-7653

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to