How to setup log4j under tomcat

From Foochal

Jump to: navigation, search

Contents

Configuration

Tomcat uses commons-logging framework, which in turn can be configured to use log4j (not tested)

Option 1

  1. Make sure that commons-logging jar is in tomcat/common/lib, and NOT in WEB-INF/lib
  2. Put your log4j.properties in tomcat/common/classes, and NOT in WEB-INF/classes

Option 2

Other supported configuration is user space configuration which will not conflict with other applications (tested)

  1. commons-logging jar in tomcat/common/lib
  2. log4j.jar in WEB-INF/lib
  3. log4j.properties in WEB-INF/classes

External links

Tomcat logging FAQ


Personal tools