[jboss-dev] My logging ultimatum

David M. Lloyd david.lloyd at redhat.com
Tue Dec 11 13:30:44 EST 2007


On Tue, 11 Dec 2007 13:03:41 -0500
"Jason T. Greene" <jason.greene at redhat.com> wrote:

> The jboss-common-logging project has a JDK appender with essentially the 
> same feature set as log4j. I myself added support for MDC and NDC awhile 
> back. So any jboss project which uses jboss-common-logging, supports 
> both JDK and log4j logging.

But you've missed the point Jason - if for example, I use jboss common
logging, now my project would require *three* JARs just for logging
(MINA uses slf4j, 

My point is that *frameworks* - all the JARs that do stuff between the
end-user code and the container - should not rely on *any* meta-logging
framework.  Yeah it sucks for framework developers, but if I were an
end-user that wants to use, say, 7 or 8 frameworks that do various
things, I wouldn't want to have to import 3 or more different logging
meta-frameworks as well - and risk projects having compatibility issues
because project A wanted one version of a logging framework and project
B wanted a different version.

The *container* definitely should provide support for applications
and libraries that use either JDK logging or log4j.

The *end-user* should be able to use whatever API that they like.
Probably they won't directly use the JDK logging API, because it's
pretty ugly.  But whether they log a message with JDK logging or log4j,
their message should end up in the log.  The important thing is that
they get the final choice of API.

However, all of us who develop all the crap in between need to think:
what dependencies are we imposing on the user?  And honestly are we
doing it for their convenience, or our own?  As a framework developer,
I'm willing to deal with the JDK logging API so that the end user
doesn't have to deal with more JARs.

- DML



More information about the jboss-development mailing list