Introduction
Tomcat uses default Java SDK Logging, which is in mine opinion, generates default log files that are hard to read and it is also quite silly to reinvent the wheel, because there is already a de-facto standard logging framework - log4j.
So lets replace the default logging framework with log4j in Tomcat.
Configuration
- Create and configure Log4J in $CATALINA_HOME/lib/log4j.properties.
- Download Log4J 1.2 to $CATALINA_HOME/lib.
- Download tomcat-juli-adapters.jar to $CATALINA_HOME/lib.
- Download tomcat-juli.jar and RELPACE existing $CATALINA_HOME/bin/tomcat-juli.jar.
- Delete $CATALINA_HOME/conf/logging.properties.
$CATALINA_HOME/lib/log4j.properties
I do not find having separate Tomcat log convenient so I let all loggers write to the same file.