[jboss-dev] My logging ultimatum

Bela Ban bela at jboss.com
Tue Dec 11 12:16:39 EST 2007


I'd love to switch over to the JDK logging (I could drop the 
commons-logging and log4j JARs), but I'm told it seriously sucks, not in 
terms of the API (which can be wrapped), but in terms of configuration 
from a users point of view. And I'm not talking about the appserver 
which comes with logging enabled, I'm talking about libs like JGroups 
which make the dev who integrates JGroups have the pain.

BTW, JGroups won't use MINA until it drops the dependency on slf4j.

David M. Lloyd wrote:
> Developing Remoting 3 I discovered that, thanks to depending on MINA
> and JBoss Serialization, I now have an indirect dependency on both
> log4j and slf4j. This sucks. I'm tired of dealing with issues with
> logging when this problem should have been solved years ago.
>
> I've asked Clebert to change JBoss Serialization to use JDK logging.
> His (valid) concern is that JBAS 4.2.x doesn't support JDK logging
> (except for the wedge that Stan Silvert wrote for JSF).
>
> My feelings are as follows:
>
> * The JBossAS logging system must be changed such that BY DEFAULT log
> messages are all handled properly (in terms of category and level),
> regardless of the logging framework used (java.util.logging or log4j).
> No, relying on the System.out/System.err capture mechanism is NOT
> sufficient for this task. This means that, as far as I can tell, we
> should always be installing a JUL LogManger on appserver startup.
> Frankly it really baffles and disappoints me that 4.0.x and 4.2.x didn't
> do this out of the box.
>
> * ALL framework devlopers should switch to java.util.logging. This is
> the ONLY way you can have logging without introducing a JAR
> dependency. Yeah the API kind of sucks, but it's easily worked around
> (here's one way: http://tinyurl.com/3848rr - notice the lack of
> external JAR dependencies). It's far better for the framework
> developer to embrace suckage, so that the end-user doesn't have to.
>
> * The end application developer should be able to use whatever
> logging API they like the best without surprises.
>
> A while back Scott indicated that there would be the option of a JDK
> logger in AS 5, and maybe it would even be the default one. The
> discussion thread is at:
>
> http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3904365
>
> though unfortunately, the whole theme of the discussion is "which
> logging framework to use, log4j or jdk" and the issue was confused by
> the faulty assumption that by using one, we would no longer be able to
> support the other. So I'm actually sort of confused as to the outcome
> of that.
>
> In any case, Remoting 3 will use JDK logging, at least until someone
> stops me. And I will continue my efforts to get JBSER and MINA changed
> over to JDK logging as well.
>

-- 
Bela Ban
Lead JGroups / Clustering Team
JBoss - a division of Red Hat



More information about the jboss-development mailing list