See my comments interspersed below:

----- Original Message -----
From: "Paul Glezen" <[EMAIL PROTECTED]>
To: "LOG4J Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, May 31, 2001 10:58 AM
Subject: Re: Tomcat problem (again)


> William Jaynes wrote:
> >
> > I trace this anomaly to the following line in Category.java
> >         url = Loader.getResource(resource, Object.class);
> > I believe that "Category.class" rather than "Object.class" should be
> > used. ...
>
> This change might help in some situations.  But it is not going to
> address the Tomcat issue.

But it does. I've made the change it it works.

>As people have pointed out, the problem is
> simple. People would like to place log4j.jar in either the Tomcat
> classpath or the WEB-INF/lib directory of their webapp.  We would like
> to place our config file closer to the app, say in WEB-INF/classes or
> WEB-INF/lib.  This allows each webapp to have their own configuration
> (assuming one JVM per webapp, not always a good assumption).  It also
> increases the potential for dynamic reconfiguration.
>
> The problem that has been hashed over and over is that classes loaded
> from jars in WEB-INF/lib or tomcat's lib don't see WEB-INF/lib or
> WEB-INF/classes.  There are no class loader games you can play to
change
> this as far as I know.  Certainly Category's classloader won't help
any
> here.

Classes loaded from jars in a web app's WEB-INF/lib *DO* see into the
app's WEB-INF/classes directory. I've have it working. As I said before,
if I change "Object" to "Category" in the static initializer in
Category.java then
the following two situations work just fine:
- log4j.jar in WEB-INF/lib and log4j.properties in WEB-INF/classes
   (local app configuration)
- log4j.jar in /tomcat/lib and log4f.properties in /tomcat/classes
   (global app configuration)

The situation that won't work is log4j.jar in /tomcat/lib and the
properties
file in a web app's WEB-INF/classes. In that situation a servlet such as
you
describe would be useful and, in fact, the only option.





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to