On Thu, 2002-07-04 at 05:52, yangjs wrote: > hi,all > The Excalibur-4.1 use LogKit ,I feel that this is a big fault in all avalon > project for me.Almost all my project already using Log4J,and now How can I > use Log4J in Excalibur-4.1 sub project ECM and so on...
hi! Most of the avalon people think it is pretty smart to use LogKit...it has some really nice features. I won't bother you with the details though. You can use Log4J with avalon as well with just a little effort. We use an abstraction to support any logging implementation, which you can find out more about from the javadocs: http://jakarta.apache.org/avalon/api/index.html ECM extends AbstractLoggable: http://jakarta.apache.org/avalon/excalibur/component/api/org/apache/avalon/excalibur/component/ExcaliburComponentManager.html extends: http://jakarta.apache.org/avalon/api/org/apache/avalon/framework/logger/AbstractLoggable.html which defines a method setLogger() which you can use to customize the logger you wish to use, in your case http://jakarta.apache.org/avalon/api/org/apache/avalon/framework/logger/Log4JLogger.html so your code becomes, roughly: // get a log4j logger somewhere Category log4jCategory = org.apache.log4j.Logger.getLogger("bla.dibla"); // use it to create an avalon framework logger org.apache.avalon.framework.logger.Logger logger = new org.apache.avalon.framework.logger.Log4JLogger( log4jCategory); // get your ECM instance ExcaliburComponentManager ecm = new ExcaliburComponentManager(); // provide your logger ecm.setLogger( logger ); and that should do it. I do not know much about ECM internals though, so if it doesn't work one of its authors will have to help you out =) Please let us know if this works (or doesn't work :/ ) for you! thanks, - Leo Simons -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>