You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@s-und-n.de> on 2004/06/08 08:44:09 UTC
[RT] Logging and log4j
Ok, the recent thread about using log4j as the default
showed that there is a big interest in directly using log4j.
Sylvain raised the concern of performance which can imho
be solved in the wrapper class. The avalon logging uses
a wrapper class around the log4j logger to conform to
the avalon Logger interface. This wrapper can store/cache
the level in an instance variable making the test
calls to isDebugEnabled() etc. as fast as possible.
Although this is an optimization in the nano area which
should neither increase/decrease performance for a
complete Cocoon request, it should solve the concern.
Now, imho only two questions remain :)
1. What should Cocoon offer to support log4j? So, everyone
out there who wants to use/is using log4j with Cocoon, what
are you missing? Examples could be, a support for configuring
log4j via Cocoon etc.
2. Should we make log4j (with the improved wrapper idea from
above) the default?
WDYT?
Carsten
Carsten Ziegeler
Open Source Group, S&N AG
http://www.osoco.net/weblogs/rael/
Re: [RT] Logging and log4j
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 8 juin 04, à 08:44, Carsten Ziegeler a écrit :
> ...1. What should Cocoon offer to support log4j? So, everyone
> out there who wants to use/is using log4j with Cocoon, what
> are you missing? Examples could be, a support for configuring
> log4j via Cocoon etc.
I think a howto about using log4j would be good, but I'm for making it
default anyway.
> 2. Should we make log4j (with the improved wrapper idea from
> above) the default?
Yes.
log4j is the best-known logging package today, and if we think there
might be a performance hit for using them (although I don't think we
have any figures yet) a technote for performance-minded people would
do.
-Bertrand, who lives almost next door to Ceki Gülcü ;-)
RE: [RT] Logging and log4j
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Ralph Goers wrote:
>
> What more support do you need than that? Are you thinking
> that Log4j's default configuration techniques are not sufficient?
>
This is the question I have no answer to :) That's why I'm interested
in other opinions etc. There are many people out there using Cocoon
with log4j and perhaps it's perfect for them already, perhaps they are
missing something which they can tell us now :)
Carsten
Re: [RT] Logging and log4j
Posted by Ralph Goers <Ra...@dslextreme.com>.
I see no reason to switch from using the LogKit LoggerManager interface.
Changing the newLoggerManager() method in CocoonServlet to default to LOG4J
and also provide an easy way to use the LogKitLoggerManager is
trivial. Anyone who wants to "try out" Log4j in 2.1.5 only needs to define
"logger-class" as "LOG4J" in web.xml as an init parm. In addition,
logger-class can specify any class that implements LogKit's LoggerManager
interface - which is why I submitted the patch.
What more support do you need than that? Are you thinking that Log4j's
default configuration techniques are not sufficient?
Ralph
At 6/7/2004 11:44 PM, you wrote:
>Ok, the recent thread about using log4j as the default
>showed that there is a big interest in directly using log4j.
>
>Sylvain raised the concern of performance which can imho
>be solved in the wrapper class. The avalon logging uses
>a wrapper class around the log4j logger to conform to
>the avalon Logger interface. This wrapper can store/cache
>the level in an instance variable making the test
>calls to isDebugEnabled() etc. as fast as possible.
>Although this is an optimization in the nano area which
>should neither increase/decrease performance for a
>complete Cocoon request, it should solve the concern.
>
>Now, imho only two questions remain :)
>
>1. What should Cocoon offer to support log4j? So, everyone
>out there who wants to use/is using log4j with Cocoon, what
>are you missing? Examples could be, a support for configuring
>log4j via Cocoon etc.
>
>2. Should we make log4j (with the improved wrapper idea from
>above) the default?
>
>WDYT?
>
>Carsten
>
>Carsten Ziegeler
>Open Source Group, S&N AG
>http://www.osoco.net/weblogs/rael/
RE: [RT] Logging and log4j
Posted by Antonio Gallardo <ag...@agssa.net>.
Carsten Ziegeler dijo:
> 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? :)
Yep. A big +1 :-D
Best Regards,
Antonio Gallardo
Re: [RT] Logging and log4j
Posted by Antonio Gallardo <ag...@agssa.net>.
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.
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?
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.
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 prefer to have (as now) LogKit as the default logger.
Best Regards,
Antonio Gallardo
[1]
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=log4j-user@jakarta.apache.org&msgId=112743
Re: [RT] Logging and log4j
Posted by Ugo Cei <u....@cbim.it>.
Carsten Ziegeler wrote:
> 1. What should Cocoon offer to support log4j? So, everyone
> out there who wants to use/is using log4j with Cocoon, what
> are you missing? Examples could be, a support for configuring
> log4j via Cocoon etc.
A simple way to fix this [1] problem.
> 2. Should we make log4j (with the improved wrapper idea from
> above) the default?
+1
Ugo
[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=108634904301262&w=2