You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Sills <DS...@datasourceinc.com> on 2012/04/03 15:40:38 UTC
Enabling logging in Tomcat 5.5
All:
I am forced by a client's requirement to use Java 1.4.2 (I know,
antediluvian, right?) and so to test on Tomcat 5.5 with the
compatibility package. So far, Tomcat works fine, with one exception: I
get no logs. I have set up logging just as suggested (in detail) in
http://tomcat.apache.org/tomcat-5.5-doc/logging.html, but without avail.
Any other ideas? My application isn't deploying, and I can't find out
why without logs, of course.
David
RE: Enabling logging in Tomcat 5.5
Posted by David Sills <DS...@datasourceinc.com>.
Actually, yes, it really doesn't work unless I explicitly set the opening classpath. I sort of got the hint when the famous error message about log4j not being configured correctly started popping up.
-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net]
Sent: Tuesday, April 03, 2012 1:23 PM
To: Tomcat Users List
Subject: Re: Enabling logging in Tomcat 5.5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David,
On 4/3/12 1:02 PM, David Sills wrote:
> It seems to be better if I create a "setenv.bat" file with this
> content:
>
> set
> CLASSPATH=..\common\classes;..\common\lib\org.apache.log4j-1.2.16.jar
You
>
shouldn't have to do that: Tomcat should auto-configure its CLASSPATH including the common locations you have specified above.
Does it really not work unless you explicitly set the CLASSPATH environment variable?
> When this is placed in the "bin" directory, it is automatically run by
> the catalina.bat file (which I discovered on walking through the
> process).
Correct. It's kind of silly to ship a completely empty file, though one could argue that a no-op file with comments in it might be a nice thing to do.
> So I am getting something. What, exactly, especially when it comes to
> application logging, I'm still working through.
Let us know how things go for you.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk97MgYACgkQ9CaO5/Lv0PCqKwCfQ1NfnI4WeKa9H7gus3eY2ftI
x2YAn3iMEtBa2XMEtcLfNkp9ejg5SQLS
=yRwx
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Enabling logging in Tomcat 5.5
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
David,
On 4/3/12 1:02 PM, David Sills wrote:
> It seems to be better if I create a "setenv.bat" file with this
> content:
>
> set
> CLASSPATH=..\common\classes;..\common\lib\org.apache.log4j-1.2.16.jar
You
>
shouldn't have to do that: Tomcat should auto-configure its
CLASSPATH including the common locations you have specified above.
Does it really not work unless you explicitly set the CLASSPATH
environment variable?
> When this is placed in the "bin" directory, it is automatically run
> by the catalina.bat file (which I discovered on walking through
> the process).
Correct. It's kind of silly to ship a completely empty file, though
one could argue that a no-op file with comments in it might be a nice
thing to do.
> So I am getting something. What, exactly, especially when it comes
> to application logging, I'm still working through.
Let us know how things go for you.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk97MgYACgkQ9CaO5/Lv0PCqKwCfQ1NfnI4WeKa9H7gus3eY2ftI
x2YAn3iMEtBa2XMEtcLfNkp9ejg5SQLS
=yRwx
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Enabling logging in Tomcat 5.5
Posted by David Sills <DS...@datasourceinc.com>.
Konstantin:
Many thanks for your questions. I am using log4j (again, client
requirement - they like the formatting and they're familiar with the
configuration files). I'm currently using a fairly current version of
log4j (1.2.16), as it seems to be compiled against the JDK 1.2 or lower
APIs (thank heavens!). It is in the common/lib and the log4j.properties
is in common/classes, as specified in the instructions referred to below
(which also specifies the contents of the log4j.properties file), but
that didn't produce any logging output, either in the standard out or in
files. It seems to be better if I create a "setenv.bat" file with this
content:
set
CLASSPATH=..\common\classes;..\common\lib\org.apache.log4j-1.2.16.jar
When this is placed in the "bin" directory, it is automatically run by
the catalina.bat file (which I discovered on walking through the
process). By default, such a file doesn't exist. This produces, at
least, a "tomcat.log" file.
So I am getting something. What, exactly, especially when it comes to
application logging, I'm still working through.
David Sills
-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
Sent: Tuesday, April 03, 2012 10:03 AM
To: Tomcat Users List
Subject: Re: Enabling logging in Tomcat 5.5
2012/4/3 David Sills <DS...@datasourceinc.com>:
>
> I am forced by a client's requirement to use Java 1.4.2 (I know,
> antediluvian, right?) and so to test on Tomcat 5.5 with the
> compatibility package. So far, Tomcat works fine, with one exception:
> I get no logs. I have set up logging just as suggested (in detail) in
> http://tomcat.apache.org/tomcat-5.5-doc/logging.html, but without
avail.
> Any other ideas? My application isn't deploying, and I can't find out
> why without logs, of course.
>
1. Do you intend to use java.util.logging or log4j ? I'd recommend the
former.
But if you have log4j.jar among "common" libraries then commons-logging
library will autoconfigure itself to use Log4J instead of
java.util.logging.
So the question is what libraries do you have and where.
2. java.util.logging should be configured by startup script to use
Tomcat implementation of it. See how catalina.sh does that (with
-Djava.util.logging etc).
So the question is how do you start your Tomcat.
3. There should be only one logging.properties for java.util.logging (or
log4j.properties for juli) in a classpath of certain class-loader.
If there are several files, one of them wins.
Do you have logging output on your console? (or catalina.out file where
it is usually redirected)?
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Enabling logging in Tomcat 5.5
Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/4/3 David Sills <DS...@datasourceinc.com>:
>
> I am forced by a client's requirement to use Java 1.4.2 (I know,
> antediluvian, right?) and so to test on Tomcat 5.5 with the
> compatibility package. So far, Tomcat works fine, with one exception: I
> get no logs. I have set up logging just as suggested (in detail) in
> http://tomcat.apache.org/tomcat-5.5-doc/logging.html, but without avail.
> Any other ideas? My application isn't deploying, and I can't find out
> why without logs, of course.
>
1. Do you intend to use java.util.logging or log4j ? I'd recommend the former.
But if you have log4j.jar among "common" libraries then
commons-logging library will autoconfigure itself to use Log4J instead
of java.util.logging.
So the question is what libraries do you have and where.
2. java.util.logging should be configured by startup script to use
Tomcat implementation of it. See how catalina.sh does that (with
-Djava.util.logging etc).
So the question is how do you start your Tomcat.
3. There should be only one logging.properties for java.util.logging
(or log4j.properties for juli) in a classpath of certain class-loader.
If there are several files, one of them wins.
Do you have logging output on your console? (or catalina.out file
where it is usually redirected)?
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org