cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: [RT] Logging and log4j
Date Wed, 09 Jun 2004 06:32:14 GMT
Antonio Gallardo wrote:
> 
> Hi Carsten:
> 
> Third time I will write the same here. Not your fault. 
:)

> I don't like the idea  to switch to log4j as the default 
> implementation. I was researching how to set in log4j the 
> file paths to WEB-INF/logs for any servlet and I don't found 
> a right answer. There were worksrounds, but no an elegant 
> solution as in LogKit.
> 
Ah, that's right. I was looking at that some time ago as well
and didn't find it. Ok, we can research this.

> I found this interesting mail in log4j. The explanation is 
> that LogKit is more oriented to IoC usage (Avalon). Quoting [1]:
> 
> <quote>
> The only real difference I see is the philosophical one of 
> how Loggers should be obtained. LogKit was designed for use 
> in frameworks where the principle of "inversion of control" 
> is extensively applied. One implication of IoC is that 
> components are passive, and interact with the outside world 
> solely through their container. There is a well-defined 
> component lifecycle. In Avalon, the first thing that happens 
> to a component is that it is *given* a Logger. It doesn't 
> request one through a static method like 
> Logger.getLogger(".."), since that would break IoC and 
> potentially cause a security risk (overhead-less security is 
> one of IoC's benefits).
> </quote>
> 
> I know the mail is already 3 years old. Can someone explain 
> if this is diferent now?
> 
No, ..eh...yes. If you're using log4j the way log4j tells
you to do, this is still the same ugly way of getting a logger.
But, with Cocoon (or with Avalon components) it's still IoC.
Your component gets a logger which might be a log4j logger 
(or anything else).

> My main concern is that in log4j you need to write an 
> "absolut path" for the log file. For me this is a step back 
> on what we have now. I really love the idea to move the 
> servlets to any location and not need to configure log file paths.
> 
Yes, I agree that writing absolute paths is really bad. (I wouldn't
put the logs into WEB-INF/logs for production systems, but that's
another story).

> I will be glad if someone can explain or write a doc telling 
> that I am wrong. I really wanted to use log4j, but not at any cost.
> 
> Second concern on the list is performance. Already discused, 
> but without a probe.
I think my suggestion covers this issue very well; there isn't
any dfference in performance then anymore.

> 
> I prefer to have (as now) LogKit as the default logger.
> 
Ok, accepted. So if we could solve the problem with the absolute paths
and the performance, I assume that you are not against it, right? :)

Thanks
Carsten


Mime
View raw message