> -----Original Message-----
> From: Vincent Massol [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 28, 2001 11:29 PM
> To: Avalon Developers List
> Subject: Re: Logging, LogKit, JDK1.4 Logging ...
>
>
> Following Peter's suggestion and my need to use log4j as the
> logger for my
> components (with ExcaliburComponentManager), I have modified
> the excalibur
> component.* classes to support other loggers. I'm still
> testing if it works
> but your mail on this subject prompted this early response.
>
> Basically I have made almot all the classes implement LogEnabled
> (ComponentManager, ComponentHandler and ComponentFactory) and
> make sure the
> manager initializes the log eanbled Logger for the handler
> and the handler
> for the factory so that we have in the factory a valid
> org.apache.avalon.framework.Logger object.
>
> The biggest change I have made is in the factory where I have added a
> makeLogEnabledLogger() which creates a logger implementation for the
> component, based on the type of logger from the factory. Thus, if you
> initially write :
>
> manager.enableLogging ( new
> Log4JLogger(Category.getInstance("....")));
>
> then, the components that implement LogEnabled will get a Log4JLogger.
> Writing this, I just realised that I forgot to take into
> account the case
> were the user would not have called enableLogging on
> ExcaliburComponentManager. We will simply need to add this case to
> makeLogEnabledLogger and default to logkit.
>
> In order to be able to compile even without log4j, I have
> used reflection to
> create a log4j logger. I have not paid attention to
> performance in this
> implementation and it can be improved performance wise. At
> this point, I
> wanted to verify if it would work and wanted to get your feedback.
Hmmm....
Now you make me wonder if I should stay with log4j because I already gave each component a category as member (base class) and made them log to a socket appender...
> As I said to Peter, I'm on a production project that has been
> going on for a
> while and which has standardised on log4j and they don't want
> to change.
> However, I'd like to bring in avalon, mainly as a
> demonstrator of how to
> code properly (and so that unit tests can be easily written
> for components
> using mock objects). I have the option of using the modifed
> component.*
> package but I would of course like to benefit from
> excalibur's modifications
> so I would of course prefer if it could be quickly included within the
> excalibur codebase. I am willing to help improve this first
> implementation
> if you agree on principle. As you are moving towards neutral
> Logger anyway,
> it seems to be inline with excalibur's future.
>
> Thoughts ?
> Thanks
> -Vincent
I currently changed my container to use logkit.
Currently I am looking through the logkit management to configure the logger from file ... but i step into an NPE.
Is there a DTD or XSD?
At least an neutral logger would be nice :-)!
> Note: I have not looked in detail in the excalibur sources so I am not
> familiar to any problem my changes could have introduced for existing
> components. Is there a full unit tests suite that I could run
> and where can
> I find the requirements/instructions for running it (link
> with environment,
> ...) ? Any mock object tests ?
Don't know either! Maybe one of the others can help us on this?
MfG, Michael
----------------------------------------- (on the network) ********************************* PRIVILEGED - PRIVATE AND CONFIDENTIAL This e-mail and files transmitted with it are intended solely for the use of the addressee(s) and may contain information which is confidential or privileged. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you receive this e-mail and you are not the addressee, or you have received this e-mail in error, please disregard the contents of the e-mail, delete the e-mail and notify the author immediately. *********************************
---------------------------------------------------------
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>