Upon starting Apache Tomcat will create several log files in the tomcat/logs directory. In this article, we’ll focus on the default and most common logging implementation used for Tomcat – the included JULI implementation.
Tomcat logging settings
The default log files and logging levels are defined in /conf/logging.properties
As of Tomcat 5.5, Tomcat uses an implementation of the Apache Commons Logging library based on the java.util.logging(JULI) framework.
JULI is implemented in $CATALINA_HOME/bin/tomcat-juli.jar.
Here’s a look at all the layers at which JULI’s logging can be configured, including both layers standard to java.util.logging and JULI’s per-classloader layers:
- logging.properties – self explanatory and located in your $JAVA_HOME/jre/lib directory
- java.util.logging.config.class – which is used for programmatic configuration
- logging.properties – located within each classloader you wish to configure.
Simple examples of the logging.properties file for both Tomcat’s core and per-web application configurations are provided on Apache’s Tomcat Documentation site.
Where are Tomcat log files
Log files are written to the /logs directory of a running instance ($CATALINA_BASE/logs).
Tomcat log files
The default log files for every Tomcat instance are:
- catalina.log – a log with entries that describe server activity
- catalina.out – a log for system output and standard error messages
- localhost.log – a log file for tracking Web application activity
- localhost_access.log – a log for tracking requests processed by the server
- host_manager.log – a log for Tomcat’s host-manager.war Web application
- manager.log – a log for Tomcat’s manager.war Web application
Tomcat logging levels
The following is a list of the JULI logging levels that apply to Tomcat.
|CONFIG||Static configuration messages|
|FINER||Detailed trace messages|
|FINEST||Highly detailed trace messages|
The list is arranged in order by level of detail from the least (SEVERE) to the greatest (FINEST). Note that a level includes all the content of previous levels.