- Create a file called log4j.properties with the following content and save it into common/classes.
log4j.rootLogger=INFO,R log4j.appender.R=org.apache.log4j.DailyRollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tomcat.log log4j.appender.MANAGER.Append=true log4j.appender.MANAGER.Encoding=UTF-8 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern = [%d] [%t] [%-5p] [%c] -%m%n
- Download Log4J (v1.2 or later) and place the log4j jar in $CATALINA_HOME/common/lib.
- Download Commons Logging and place the commons-logging-x.y.z.jar (not commons-logging-api-x.y.z.jar) in $CATALINA_HOME/common/lib with the log4j jar.
- Start Tomcat