tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Tomcat Wiki] Update of "FAQ/Logging" by plinius
Date Tue, 07 Apr 2009 00:44:17 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification.

The following page has been changed by plinius:
http://wiki.apache.org/tomcat/FAQ/Logging

------------------------------------------------------------------------------
   1. [#Q6 Where does System.out go? How do I rotate catalina.out?]
   1. [#Q7 Where are the logs when running Tomcat as a Windows service?]
   1. [#Q8 How do I customize the location of the tomcat logging.properties file?]
+  1. [#Q9 Since java.logging is the default commons-logging implementation in Tomcat, why
is it not working in my Linux distribution?]
  
  == Answers ==
  
@@ -57, +58 @@

  
  [[Anchor(Q4)]]'''How do I configure commons-logging for use with Tomcat?'''
  
+ You need to specify a commons-logging configuration file and, if you wish, a logging implementation
that supports commons-logging. JDK 1.4 (and later) java.util.Logging and Log4j are the two
most commonly used logging toolkits for Tomcat.
+ Tomcat 5.5 and Tomcat 6.0 use java.logging as default implementation for commons-logging.
So this ''should'' work by default, but sometimes it doesn't (see [#Q9]).
- You need to specify a commons-logging configuration file and, if you wish, a logging implementation
that supports commons-logging. JDK 1.4 (and later) java.util.Logging and Log4j are the two
most commonly used logging toolkits for Tomcat. If you supply an external logging toolkit
such as Log4J, it needs to be located in the $CATALINA_HOME/common/lib directory (for Tomcat
5.0 and earlier). Tomcat 5.5 and later uses commons-logging  while bootstrapping so some people
suggest adding Log4j to the bootstrap classpath by using the scripts in $CATALINA_HOME/bin
(see [http://markmail.org/message/3sgxfol3njcfutsm Need for it to be in bootstrap classpath?]).
A better approch apparently working is:
+ If you supply an external logging toolkit such as Log4J, it needs to be located in the $CATALINA_HOME/common/lib
directory (for Tomcat 5.0 and earlier). Tomcat 5.5 and later uses commons-logging  while bootstrapping
so some people suggest adding Log4j to the bootstrap classpath by using the scripts in $CATALINA_HOME/bin
(see [http://markmail.org/message/3sgxfol3njcfutsm Need for it to be in bootstrap classpath?]).
A better approch apparently working is:
    1. Put jog4j.jar in the $CATALINA_HOME/common/lib directory
    2. Put the ''full'' commons-logging.jar in the $CATALINA_HOME/common/lib directory, even
if you see the ''reduced'' API version there, named commons-logging-api.jar
  
@@ -111, +114 @@

  startup script.
  
  On Fedora the startup script in typically located in /etc/rc.d/init.d/ and on
- Gentoo linux it is located in /etc/init.d/.
+ Gentoo linux it is located in /etc/init.d/. On RedHat the startup script for Tomcat 5.5
is /etc/init.d/tomcat5 but eventually the real startup script is /usr/bin/dtomcat5.
  
+ [[Anchor(Q9)]]'''Since java.logging is the default commons-logging implementation in Tomcat,
why is it not working in my Linux distribution?'''
+ 
+ Yes, if you read Tomcat logging documentation, it says java.util.logging should work by
default. But many Linux distribution repackage Tomcat and sometimes it does NOT work by default.
+ 
+ Here are some things you can check:
+  1. tomcat-juli.jar should be in your $CATALINA_HOME/bin directory
+  1. tomcat startup script should run java with -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
+  1. tomcat startup script should run java with -Djava.util.logging.config.file=''<some_path>''/logging.properties
+  1. obviously, the logging.properties file must exist in the directory specified in the
tomcat script at point #3
+ 
+ If you don't know where to look for your Tomcat startup script, see the previous [#Q8 How
do I customize the location of the tomcat logging.properties file?]
+ 
+ In RHEL5 (RedHat Enterprise Server 5) the Tomcat 5.5 rpm installation does not include the
tomcat-juli.jar file. This is what I made:
+  * look for what Tomcat version you got installed with: yum list installed tomcat5
+ Since I had the 5.5.23, I downloaded the Tomcat Binaries 5.5.23 from http://archive.apache.org/dist/tomcat/,
then:
+  * tar xf apache-tomcat-5.5.23.tar.gz
+  * cd apache-tomcat-5.5.23/bin
+  * cp tomcat-juli.jar /usr/share/tomcat5/bin/
+ Restart Tomcat... and it's working!
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message