struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Cannot specify multiple log files with CommonsLogging/Log4j
Date Wed, 14 Aug 2002 19:06:28 GMT

On Wed, 14 Aug 2002, Greg Hess wrote:

> Date: Wed, 14 Aug 2002 14:36:47 -0400
> From: Greg Hess <>
> Reply-To: Struts Users Mailing List <>
> To: Struts Mail List <>
> Subject: Cannot specify multiple log files with CommonsLogging/Log4j
> Hi All,
> I am deploying multiple instances of the same web app in the same web
> container Resin2.1.2. I would like to have each web application use a unique
> log file to simplify bug tracking. I am specifying the
> log4j.appender.rolling.File=logs/appinstance1701794474_65.log with a new log
> file for each deployed app.
> I had expected when each new app is initialized it would initialize its
> logging implementation through Commons.logging and
> private static final Log m_log = LogFactory.getLog(SQLManager.class);
> Would return the logging implementation for this web app. What happens is
> that I receive a org.apache.commons.logging.Log but it uses the log file of
> the first initialized web app.
> I didn't think this was possible as each web app runs in its own VM and
> LogFactory.getLog(SQLManager.class) could only return instantiated Log
> implementation for the given web app.

Does Resin really do that (VM per webapp)?  That would be pretty

On Tomcat, or other containers that use a single VM for all webapps, you
can accomplish what you are after by putting commons-logging.jar, Log4J,
and all of your classes inside the webapp, instead of in a shared
directory.  Then, "static" variables are per-webpp instead of global.

> Does anyone know why this is happening?
> Thanks for your time,
> Greg


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

View raw message