On 24/10/2007, at 1:53 AM, Curt Arnold wrote:


On Oct 23, 2007, at 8:22 AM, David R Robison wrote:

We have an application that uses log4j as its logger. However, it uses a third-party library that uses java.util.logging. Is it possible to get the java.util.logging logger to log through log4j?
Thanks, David Robison



Please look through the log4j-dev archives for "bridge" in the last year. There are efforts in the development sandbox to provide bridges between log4j and java.util.logging. They currently experimental, but I believe they are functional. I personally wasn't involved in their development, so I can't speak for their current condition, but maybe that will get you started until someone more familiar with the efforts speaks us.

Curt is referring to the jul-to-log4j-bridge, which is currently in a sandbox state, but _should_ have all the workings you need. It's not officially released, but I'd really love some feedback and real-world testing information.

Note: You need to use log4j 1.2.15, it is not compatible with earlier versions as it needs to use newer api calls in log4j.

I've placed a maven-generated site here:

http://people.apache.org/~psmith/logging.apache.org/sandbox/jul-log4j- bridge/

The latest snapshot is here:

http://people.apache.org/~psmith/logging.apache.org/repo/org/apache/ logging/apache-jul-log4j-bridge/1.0.0-SNAPSHOT/apache-jul-log4j- bridge-1.0.0-20071007.235256-4.jar

The idea is you can configure log4j to 'assimilate' the java.util.logging system into log4j, all corresponding loggers in the jdk1.4 logging system are mapped into the log4j system allowing you to configure them as normal log4j logging events. The bridge routes the events into log4j.

Let me know how you go if you choose to try it.

cheers,

Paul

Reply via email to