The Apache Tomcat Servlet/JSP Container

Apache Tomcat 7

Version 7.0.94, Apr 10 2019
Apache Logo


User Guide


Apache Tomcat Development

Logging in Tomcat

Table of Contents

Logging in Apache Tomcat is implemented with the help of Apache Commons Logging library. That library is a thin wrapper above different logging frameworks. It provides Tomcat with the ability to log hierarchically across various log levels without the need to rely on a particular logging implementation.

Since Tomcat 6.0, Tomcat uses a private package-renamed implementation of Apache Commons Logging, to allow web applications to use their own independent copies of the original Apache Commons Logging library. In the default distribution this private copy of the library is simplified and hardcoded to use the java.util.logging framework.

To configure Tomcat to use alternative logging frameworks for its internal logging, one has to replace the logging library with the one that is built with the full implementation. Such library is provided as an extras component. Instructions on how to configure Tomcat to use Log4j framework for its internal logging may be found below.

A web application running on Apache Tomcat can:

  • Use system logging API, java.util.logging. HTTP/1.1 403 Forbidden Content-Type: text/html Content-Length: 134 Connection: close 403 Forbidden

    403 Forbidden