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

------------------------------------------------------------------------------
  
  [[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. 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) 
or added to the bootstrap classpath by using the scripts in $CATALINA_HOME/bin 
(this is required for Tomcat 5.5 and later, which uses commons-logging while 
bootstrapping, and optional for Tomcat 5.0 and earlier).
+ 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:
+   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
+ 
+ Through some classloading voodoo during bootstrapping, if you have the full 
commons-logging.jar file in your common/lib directory, it replaces the classes 
from the commons-logging-api.jar file and will reinitialize the logging system 
and attempt to locate log4j or whatever other logging system you may be using. 
(see 
[http://markmail.org/message/3sgxfol3njcfutsm#query:+page:1+mid:7oce37bngiq2otlu+state:results
 this thread).
  
  For more detailed instructions, see these mailing list discussions:
  
   * [http://marc.theaimsgroup.com/?l=tomcat-user&m=106623436423859&w=2 A log4j 
example]
   * [http://marc.theaimsgroup.com/?l=tomcat-user&m=108330970225012&w=2 Logging 
Configuration]
   * [http://marc.theaimsgroup.com/?l=tomcat-user&m=108578233003073&w=2 Example 
with JSVC and running on port 80.]
-  * [http://markmail.org/message/3sgxfol3njcfutsm Need for it to be in 
bootstrap classpath.]
+  * [http://minaret.biz/tips/tomcatLogging.html Tomcat and Log4j Configuration 
(and Velocity), addressing and solving the bootstrap commons-logging.jar 
problem]
  
  [[Anchor(Q5)]]'''How should I log in my own webapps?'''
  

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

Reply via email to