You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by piercey <pi...@gmail.com> on 2008/10/02 18:52:33 UTC

Tomcat 5.5.x - Logging Issues

Hi,

We use a proprietary application in work with Tomcat. The webapp is
basically a frontend to a process that runs in the background separate to
Tomcat. It uses log4j to produce its own log files, which are stored in it's
own directory again separate of Tomcat. This setup worked ok in Tomcat
4.1.x, but I decided to upgrade to a newer version (with support for JDK
1.4.2). 

Anyway, the problem comes when I try to log in to the webapp, I get an
Exception with the root cause being:
java.lang.NoClassDefFoundError: org/apache/log4j/Priority

The webapp includes the log4j.jar file in its WEB-INF/lib directory, however
it seems Tomcat isn't loading it (it does not have a log4j.properties or
log4j.xml file). After some googling, I found quite a lot of information on
how Tomcat 5.5 moved to a different logging structure. 

So I attempted to follow guides which tell me to put log4j.jar and
commons-logging.jar in my common/lib directory. The problem persisted. Then
I tried placing the log4j.jar file in common/endorsed and the error went
away. I was able to log in. 

However now Tomcat is using log4j as its form of logging which isn't
something I wanted. Is there an easier solution to getting it to behave like
it did on Tomcat 4.1.x? Admittedly I am a complete noobie when it comes to
Tomcat (and Java logging) so please excuse my ignorance if I'm making a
glaring mistake.

Thanks,
-- 
View this message in context: http://www.nabble.com/Tomcat-5.5.x---Logging-Issues-tp19783258p19783258.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 5.5.x - Logging Issues

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Piercey,

piercey wrote:
> This setup worked ok in Tomcat 4.1.x, but I decided to upgrade to a
> newer version (with support for JDK 1.4.2).

Note that Tomcat 4.1.x should happily work under JDK 1.4.x.

> Anyway, the problem comes when I try to log in to the webapp, I get an
> Exception with the root cause being:
> java.lang.NoClassDefFoundError: org/apache/log4j/Priority

[snip]

> However now Tomcat is using log4j as its form of logging which isn't
> something I wanted. Is there an easier solution to getting it to behave like
> it did on Tomcat 4.1.x? Admittedly I am a complete noobie when it comes to
> Tomcat (and Java logging) so please excuse my ignorance if I'm making a
> glaring mistake.

If you want to move to Tomcat 5.5 and keep your logging working similar
to your 4.1.x setup, you'll have to read
http://tomcat.apache.org/tomcat-5.5-doc/logging.html (perhaps a second
time).

You are not required to use log4j at the Tomcat level (though it's weird
that you had to put log4j.jar into common/endorsed) to get things to
work. Tomcat really should allow you to load your log4j.jar file from
the webapp's WEB-INF/lib directory (we do this right now on 5.5.26 with
no problems).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjqZQUACgkQ9CaO5/Lv0PC9GgCcCIkoXGpp7OvhtO75BZX/ja6M
gXAAnjBysLl1C2ibcW0M0TWqClzUdxNY
=ljD0
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 5.5.x - Logging Issues

Posted by André Warnier <aw...@ice-sa.com>.
piercey wrote:
Is there an easier solution to getting it to behave like
> it did on Tomcat 4.1.x? 
I second the motion.

Admittedly I am a complete noobie when it comes to
> Tomcat (and Java logging) so please excuse my ignorance if I'm making a
> glaring mistake.
That one too.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org