• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

How to get the tomcat internal log out?

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 21625
147
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
catch it before it slithers away! Oh wait, it's a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!