ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | architecture List | September 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [architecture] Re: [monolog] LogManager#addLogger breaks classloader isolation


On Wednesday 07 September 2005 04:58, Serge Lacourte wrote:
> > The problem is that it is currently impossible to have two copies
> > of Monolog loaded by two distinct classloaders.
>
> i ran into this problem in using monolog with oscar.

If you are seriously looking for ways to fix this, may I suggest
having a quick look at jakarta-commons-logging?  It, like Monolog,
allows the use of java.util.logging.* as the backend, but it doesn't
rely on java.util.logging.LogManager#addLogger, which seems to be at
the root of the problem in Monolog according to my superficial
analysis.

Also, you may want to know that a similar problem exists when you use
log4j as the underlying backend for Monolog:

  - 
http://forge.objectweb.org/tracker/index.php?func=detail&aid=303971&group_id=41&atid=100041
  - 
http://forge.objectweb.org/tracker/download.php/41/100041/303971/292/bug-description.txt
  - 
http://forge.objectweb.org/tracker/download.php/41/100041/303971/295/2005-08-26-update.txt


A better solution may be to get rid of Monolog entirely and use
java.util.logging.* or log4j directly.

Wrapper logging frameworks like Monolog and commons-logging are
problematic for two reasons:

 (a) The entire concept of trying to reduce the undesirable
     proliferation of logging APIs by introducing yet another logging
     API is fundamentally flawed.

     When you create a wrapper whose purpose is to provide a unifying
     facade to two different APIs, you don't unify anything.  You just
     end up creating a *third* API where there have previously been
     only two.

 (b) Wrapper frameworks are suprprisingly hard to implement.

     Ceki Gülcü has written extensively on this topic:

       http://www.qos.ch/logging/

     Pretty much everything he says about commons-logging applies
     doubly to Monolog.  (The reason he never mentions Monolog is
     because it has no users outside of ObjectWeb, whereas
     commons-logging has a significant market penetration.)

     For a less technical introduction to this topic, see also Hani
     Suleiman's rants:

       - http://jroller.com/page/fate?entry=clogging_revisited
       - http://jroller.com/page/fate?entry=ceki_g%C3%BClc%C3%BC_is_sick
 

If you insist on having a wrapper framework, then SLF4J (formerly
known as UGLI) seems like the most elegant solution to the numerous
classloader problems described in the above references:

  http://www.slf4j.org/

Unfortunately, it seems unlikely at this point that SLF4J will ever
gain sufficient critical mass to displace commons-logging.



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.