tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sills" <DSi...@datasourceinc.com>
Subject RE: Enabling logging in Tomcat 5.5
Date Tue, 03 Apr 2012 17:02:54 GMT
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 <DSills@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


Mime
View raw message