At 21:40 21.04.2001 -0700, you wrote:


>On Sat, 21 Apr 2001, Glenn Nielsen wrote:
>
>> Ceki Gülcü wrote: 
>>
>>> One important point to remember is that each
>>> webapp classloader could load a fresh copy of log4j so that each
>>> webapp has its own logging universe. >
>> 
>> This would significantly increase the memory footprint required for
>> logging in the JVM. I would prefer that log4j be global.
>> 
>
>Log4J is nothing compared to having multiple XML parsers in memory :-)
>
>Actually, it is technically feasible to do this either way -- if you put
>the Log4J JAR file in common/lib instead of server/lib it becomes
>available to the webapps as well.  The disadvantage is that the static
>variables really are global instead of once per web app (which they would
>be if each webapp installed its own copy), so they would share the same
>set of Log4J categories, appenders, and so on.

One of the reasons for adding multiple-hierarchy support to log4j was to allow each 
webapp or virtual host to support logging independently of other webapps or virtual 
hosts. Given that each webapp has its own classloader AFAIK there is no need to use a 
custom hierarchy which is significantly more difficult to manage than the default 
hierarchy. So the support for multiple hierarchies is there but perhaps not needed, at 
least not for the logging done by the webapps.

Ceki

Reply via email to