File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

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( and adding below 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.appender.R.layout.ConversionPattern=%p%t%c-%m%n[Catalina].[localhost]=DEBUG, R, R, 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: 17417

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: How to get the tomcat internal log out?
It's not a secret anymore!