cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: Porting Cocoon Logging to Log4j - Proposal and Discussion
Date Thu, 28 Aug 2003 13:06:18 GMT
Robert Simmons wrote:

> One of the major implementaiton complaints I have about Cocoon is its lack
> of Log4J logging functionality. Log4j, is without a doubt the best logging
> package for java. No other package can even hope to compare to it. If Cocoon
> was built to use Log4j instead of the avalon logging mechanism, it would
> gain an enormous amount of functionality that it lacks now.

It is doable with Fortress, Merlin, or Phoenix.  Phoenix is not designed for
Cocoon like applications, so your choise is Fortress and Merlin.  There is
already support for it.

> Personally, when working in a production environment, I dont want my log
> files to be put into direcroies in my web app. Id rather have them forwarded
> to a central log accumulation server or even sent out via JMS. Log4j allows
> this and many more configurations. Furthermore, it allows you to turn on and
> off logging on individual components with ease. Finally, Log4J is used in so
> many other products that it is a recognized standard logging mechanism that
> many organizations and even network engineers are quite familiar with.

Still doable with LogKit.

As to turning logging on and off to individual components:

It is assuming that you have a class name == component name relationship.  That
is not really helpful in a situation where we have many instances of the same
class.  LogKit can turn on and off individual *categories* which is what Log4J
does.  Both provide this ability.

> Therefore, I think Cocoon should migrate to Log4j. In order to contemplate
> this, its important that we discuss the complexities of it in the following
> quesitons.
> 1) Why has this not already been done? Is it a question of a lack of
> manpower or expertise? If so then I as well as others would most likely be
> happy to volunteer time to accomplish it.

Avalon has a logger wrapping system.  All that needs to be done is rip out
the LogKit backed loggers and place in the Log4J ones.  That is assuming
that all logging components are using LogEnabled as opposed to Loggable.

> 2) How difficult is it to rip out the avalon logging from the cocoon core
> components? Im no avalon expert so I couldnt answer this myself.

Not hard at all.  The main thing I would advise against is using the static
accessors.  The components are assigned the categories from the container,
and I would prefer to keep it that way.

> 3) Is there standard expressions that can be used for locatting logging
> lines in cocoon?

Not sure.  No need for it though.

> 4) Do we upgrade some of the blocks or leave them as is and only upgrade
> core cocoon?

You only need to upgrade the core cocoon.


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

View raw message