commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject [logging] detecting logging libs
Date Sun, 22 May 2005 23:24:01 GMT
On Sun, 2005-05-22 at 21:01 +0100, robert burrell donkin wrote:
> On Sun, 2005-05-22 at 10:43 +0000, wrote:
> <snip>
> >      protected boolean isJdk13LumberjackAvailable() {
> >  
> > +        // note: the algorithm here is different from isLog4JAvailable.
> > +        // I think isLog4JAvailable is correct....see bugzilla#31597
> +1
> could do with going through all the isAvailable's and checking whether
> their algorithms are correct. however, i suspect that brian's approach
> will be needed to deal correctly with some circumstances. if no one
> feels like volunteering should probably record this in bugzilla so we
> don't lose track...

If by "brian's approach" you mean creating an instance of the logger
class in order to test whether that logging lib is *really* available, I

Not only is it more reliable, but it's a cleaner solution; currently the
LogFactoryImpl class is making *assumptions* about what classes the
various logging adapters depend on. That information should be only in
the logging adapter class.

The only problem with creating an instance of the logger is that we
would have to pass a category string to the logger constructor, and
therefore must build an assumption into LogFactoryImpl about what
category names are valid for the underlying logger. Can we assume that
an empty string is a valid category for all logger libraries? Can we
assume that "apache" or "org.apache.commons.logging" are valid category
strings? Perhaps some loggers only accept valid URLs as
categories...yes, I'm playing devil's advocate a bit here. I guess we
could always say that the writer of the logging adapter is required to
return a valid logger instance for category "", even if that is not
normally a category that is valid to the underlying library.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message