[jboss-dev] Re: Something of interest to anyone who has to deal with java.util.logging vs. log4j vs. commons-logging vs. ....

Scott M Stark scott.stark at jboss.com
Wed Nov 8 06:13:20 EST 2006


I did the opposite and ported a number of the log4j appenders and 
configuration to jdk logging so that you essentially had the same 
configuration as the current log4j.xml and is in the common project:
https://svn.jboss.org/repos/common/common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/

We talked about where to go with logging some here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3904365

David M. Lloyd wrote:
> In the course of developing and debugging the jBPM web app (which uses a
> number of Sun libraries), I dusted off and finished an old thing I had
> started a while ago which basically adapts java.util.logging into log4j.
> I was telling Jason Greene about it and he suggested I forward it on to
> you to see what you think of it.
>
> I put the source into my personal repository at
> http://svn.flurg.com/java/logbridge ... also I've created a release of
> the current stable version which can be gotten directly from
> http://java.flurg.com/downloads/logbridge-1.0.0.jar .
>
> Basically you use it by passing
> "-Djava.util.logging.manager=logbridge.SourceLogManager" to the JVM at
> startup.  You also have to have log4j in your initial classpath (this
> kinda sucks but I can't think of another way around it).
>
> It works by creating a custom LogManager that replaces the standard
> Logger with one that wraps an equivalent log4j Logger.  Also it maps log
> levels in a fairly intuitive way (at least, in my opinion).  There's
> some weak reference stuff in there to make sure that it doesn't hold on
> to other people's classloaders.
>
> Anyway, have a look if you want.  I didn't spend too much time on it,
> because I'm sure if I did, Tom would give me a hard time about it. :-)
>
> But I admit that I envision this kind of thing as a replacement for
> commons logging.  People can just use the logging API built in to their
> JVM, and we catch it and make it look nice in our log file by using the
> log4j appenders instead.
>
> - DML
>
>   




More information about the jboss-development mailing list