Hi David,

On Dec 17, 2007 5:46 PM, David M. Lloyd <[EMAIL PROTECTED]> wrote:
> On Mon, 17 Dec 2007 17:29:24 +0100 "Maarten Bosteels"
> <[EMAIL PROTECTED]> wrote:
>
> > I agree, there are currently two logging facades that are widely used
> > by frameworks/libraries: jakarta-commons-logging (JCL) and SLF4J.
> > The consequence is that for any project with dependencies, there is a
> > reasonable chance that both logging facades need to be on the
> > classpath. But is that a problem ?
> >
> > Our application depends on JCL (because of spring,) and on SLF4J
>       ^^^^^^^^^^^
> > (because of MINA) and we let both facades point to log4j.
> > Works pefectly. Really, I do not see the problem.
> >
> > Of course, I would prefer it if we would only need SLF4J, but that's a
> > problem that MINA can not solve.
>
> Some people have feelings stronger than preference about it.  Also keep
> in mind: you've got an application.  You are not developing a framework.
>
> How would you feel about things if MINA required slf4j AND jcl AND
> log4j?  That would seem excessive, would it not?  It might even affect
> one's willingness to use the framework.

Suppose I am developing framework X that depends on projectA, projectB
and projectC
and suppose also that
* projectA requires SLF4J
* projectB requires JCL
* projectC requires log4j

Then I would take these steps to try to improve the situation:
(1) try (hard) to convince the projectC team to switch to SLF4J
(2) when (1) fails: search an alternative for projectC
(3) try (probably less hard) to convince the projectB team to use
SLF4J instead of JCL
(4) if (3) fails, explain to the users of X why they need both jcl and
SLF4J on their classpath
(5) live with it.

> This is the situation that I (and others with whom I work) face
> currently.  As a framework developer, I would not care if there was
> only one logging dependency - but the other libraries that my project
> depends on all use different logging frameworks.  This especially
> becomes an issue if you consider the wider world of software (beyond
> ASF projects).  Though most ASF projects use slf4j or jcl, this is not
> true in general terms.

So, you would be better off trying to convince the teams of these
non-ASF projects to switch their logging framework ?

>
> Therefore I am making an effort to convince the author(s) of these
> frameworks upon which my project relies, to consider making logging
> either configurable with no dependencies, or optional altogether.
> Using JDK logging seems like a reasonable compromise.

IMO, SLF4J makes logging configurable AND optional (using slf4j-nop.jar).

regards,
Maarten

Reply via email to