File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes How to get the tomcat internal log out? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to get the tomcat internal log out?" Watch "How to get the tomcat internal log out?" New topic
Author

How to get the tomcat internal log out?

Kurt Xu
Ranch Hand

Joined: Sep 29, 2009
Posts: 32
Hello all:

I compile tomcat 5.5.30 and import it to eclipse as a project, to research how the tomcat load class , I need to view the running log ,after reading through this post(http://tomcat.apache.org/tomcat-5.5-doc/logging.html) and adding below log.properties to the direcotry 'common/classes' and log4j-1.26.jar to common/lib, logs turned out not to be generated when I debug the project starting from class Catalina. No idea about it, I've tried many times.

log4j.rootLogger=DEBUG,R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=k:\\logs\\tomcat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p%t%c-%m%n
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG, R
log4j.logger.org.apache.catalina.core=DEBUG, R
log4j.logger.org.apache.catalina.session=DEBUG, R


And the program parameter I use is 'start', vm parameter is '-Dcatalina.home="I:\My Documents\program\java\projects\eclipse\mye9.0\TOMCAT_5_5_30\mybuild-5.5.30"'
Any ideas? Thanks


Kurt Xu
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

1. Obligatory observation: the documentation on customizing Tomcat logging omits to make it clear that they're only talking about customizing the logging of the Tomcat server itself. Webapps are responsible individually for their own logfiles. This caused me a lot of confusion.

2. Tomcat 7 is now in production. I don't know what Tomcat 5.5's end-of-life schedule is, but I know of no compelling reason to use 5.5 anymore. Tomcat versions 6 and later no longer have 3 separate "lib" directories, so might as well get prepared.

3. On minor little detail you might have missed in all the confusion: In order to get Tomcat to use log4j instead of the default JULI logging, you have to actually build your own custom copy of Tomcat. It's not simply a config option. That's also going to be true in Tomcat 6 and Tomcat 7 as far as I'm aware.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get the tomcat internal log out?