commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject Re: [logging] How to get logging to use new Monolog subclass
Date Mon, 10 May 2004 08:56:16 GMT
On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
> Hollowing Simon's suggestion, I am posting the same question under another
> Subject.
> And to be more specific: I am working tiwht Monolog logger that implements
> and extends log4j functionality. I needed a new Log impl. in commons logging
> to be able to use Monolog logger with tomcat.
> Hopefully this clears it up. And here's the first post:
> I've working with commons logging for the past week and have implemented a
> new logger within for my needs.
> Now, since I am not confortable with the whole commons package yet and the
> user's guide doesn't help much, could anyone explain me step by step how to
> set-up my system to use the new logger?

Cool, I'll have to look into monolog a bit.

As Jose mentioned, you can just set a system property on the jvm command
  java -Dorg.apache.commons.logging.Log=your.log.class
(described in the LogFactoryImpl javadoc)

This is fine for debugging, but isn't very nice when building
frameworks, etc. But from a quick peek at the code, it looks like you
can also create a file "" and put it in the
classpath, with these contents:


And as a third option, it looks like you could define your own
LogFactory subclass, and then specify it by creating a file:
with its first line being:

I've only used the -D approach myself, so the above might be wrong. As
always, the source code is the official and final documentation! The
LogFactory and LogFactoryImpl classes are the ones that control all this



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message