Hi Wolfgang, thanks to you and to Dominique for your fast replies. I already tried out the Avalon solution and it works perfectly!
best regards Thomas (glad) ;-) -------- Original-Nachricht -------- Datum: Fri, 20 Oct 2006 10:56:38 +0100 Von: Joachim Wolfgang Kaltz <[EMAIL PROTECTED]> An: [email protected] Betreff: Re: Logging in costum classes by using avalon mechanism > [EMAIL PROTECTED] schrieb: > > > I am facing the following problem now: I wrote other classes who's > methods become called within my transformer. But how can I output logger > messages within these classes? > > (...) > > Hi Thomas, > > the Avalon logger is only provided (and initialized correctly) > automatically to classes when these are Avalon components. > To use an Avalon logger in non-Avalon components, you can do this: > - pass a Logger instance to the class, for example to the constructor. > This is easy if you are calling it from a custom transformer, just use > getLogger(). Then, call the following code before actually using the > logger in that class: > ContainerUtil.enableLogging(this, logger); > (assuming "logger" is the instance of Logger that is passed) > - make the class extend AbstractLogEnabled. That way, you avoid having > to handle the logger instance and can call getLogger() just like you > would in a Cocoon/Avalon component, for example > if (getLogger().isDebugEnabled()) getLogger().debug("hello world"); > > You can find some examples of this kind of usage within the Lenya code. > > > -- > Wolfgang > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
