commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: NEWBIE: commons-logging and log4j.configuration
Date Mon, 23 Jun 2003 17:05:13 GMT

On Mon, 23 Jun 2003 wrote:

> Date: Mon, 23 Jun 2003 15:17:58 +0200
> From:
> Reply-To: Jakarta Commons Users List <>
> To:
> Subject: NEWBIE: commons-logging and log4j.configuration
> Hi!
> commons-logging is what I'm looking for! I try to integrate log4j in my
> application but I'm not sure if I maybe switch later on to the jdk 1.4
> logger. Therfore one common interface is perfect.
> BUT: I tried to use a different name for the file. This
> works fine as long as I add the -Dlog4j.configuration to my vm call! But
> here is the problem:
> 1.) I'm working on an app server and this would mean setting the log4j
> file for all apps running on this server - that's not what I call
> comfortable!
> 2.) I would like to have an easy to change config-file entry somewhere.
> It's of no use to say to an admin change the startscript of the server so
> we can switch to a different logkit!?
> Therefore is there a alternative way how I can tell commons-logging that
> it should use a different config file?

The commons-logging package does not actually read the configuration file
for your underlying logging system -- so this is really a Log4J user
question.  The online Log4J manual includes some info on "Configuration"

or you could ask on the Log4J user list.

Commons-logging does default to Log4J if it's visible to your application,
falling back to JDK 1.4 logging (if you're on that JDK) or a simple
System.err logger otherwise.  That decision can be configured with a file, as described in the C-L docs, but C-L
doesn't know anything about how you actually configure the underlying

> Thanks for every useful reply,
> Chris.


View raw message