Home > Uncategorized > How to create excessive log for Tomcat?

How to create excessive log for Tomcat?

1. create log4j.properties and place it under $CATALINA_HOME/lib.

  log4j.rootLogger=DEBUG, stdout, R 
  log4j.appender.R=org.apache.log4j.RollingFileAppender
  log4j.appender.R.File=${catalina.home}/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.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%p %t %c – %m%n

2. place log4j-1.2.8.jar in $CATALINA_HOME/lib.  (Search in your computer, you may find one)

3. Build the additional component commons-logging (This is not regular commons-logging from apache commons project) . To build it, you require ant build script named extras.xml which is there in Tomcat source bundle.

Replace $CATALINA_HOME/bin/tomcat-juli.jar with output/extras/tomcat-juli.jar.  (which is in the bin folder)

Place output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib.

Start Tomcat
3. Add the following properites build.properties.default
proxy.use=on
proxy.host=cbp-ca-1.link.net
proxy.port=8080

4. CREATe a folder named “classes” under “apache-tomcat-6.0.14-src\output\”

5. log4j-1.2.8.jar under lib folder

6. log4j.properties placed under lib

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: