logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Richard Keech" <ke...@qwest.net>
Subject my log4j xml configuration file cannot find dtd unless I use a full http url
Date Thu, 05 Apr 2001 05:12:31 GMT

Our servlet/jsp application runs in Websphere 3.5.3. We developed it in
Visual Age for Java 3.5 with its Websphere Test Environment (WTE). WTE is
simplified version of the real Websphere 3.5 environment.

I'm configuring log4j during the servlet init() method using the
DOMConfigurator.configure(<filename>). I initialize it with the path of my
log4j.xml configuration file. The log4j.dtd is in the same directory as the
log4j.xml and that directory is on the Servlet application class path.

The log4j.xml has the typical header:

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

In the Visual Age for Java WTE, this works fine ... no problem.

But in the Websphere 3.5, same scenario, it doesn't work. The log4j.xml
cannot locate the log4j.dtd. I tried several different relative paths for
"log4j.dtd" to no avail.

Finally, I moved the log4j.dtd into the document root of my webserver and
changed the log4j.xml header to:

<!DOCTYPE log4j:configuration SYSTEM "http://satweb5/log4j.dtd">

This worked fine. However, I prefer the "log4j.dtd" style to
http://satweb5/log4j.dtd because I don't have to reconfigure going from
development to test to production webservers. I also think it would be

I am sure this problem is just a symptom of how WebSphere 3.5 sets it's
class path and class loader for each web application.

Anybody got any suggestions how I can get the relative path location working
with the log4j.dtd? Is anyone else using log4j in servlets?

Steven Richard Keech

To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org

View raw message