This section examines the log files generated by the Tomcat Servlet Container, and the information found in them.

Tomcat logs/ Directory

Look at the different types of log files generated in the ${tomcat_home}/logs directory. Move into the logs/ directory to see the type of information logged (${tomcat_home} is /usr/local in this example):

# cd /usr/local/tomcat/logs

# ls -l
-rw-r----- 1 root root 23451 Oct 24 14:17 catalina.2018-10-24.log
-rw-r----- 1 root root 23451 Oct 24 14:17 catalina.out
-rw-r----- 1 root root     0 Oct 24 13:41 host-manager.2018-10-24.log
-rw-r----- 1 root root  1929 Oct 24 14:17 localhost.2018-10-24.log
-rw-r----- 1 root root   859 Oct 24 13:45 localhost_access_log.2018-10-24.txt
-rw-r----- 1 root root     0 Oct 24 13:41 manager.2018-10-24.log

Try this exercise

Examining catalina.out. Open another terminal window (here after referred to as terminal #2) and run the following command in the new terminal:

# tail -f /usr/local/tomcat/logs/catalina.out

In your original terminal window, start/stop and start Tomcat and watch what is being logged to catalina.out in the terminal #2 window.

Things To Know About catalina.out

  • Tomcat System.out and System.err gets appended to catalina.out. catalina.out can quickly grow large if the hosted web applications are not specifically catching and logging System.out and System.err to designated files.
  • catalina.out is not automatically rotated in Tomcat.
  • You should employ an outside log rotation program (e.g., logadm or logrotate) to rotate catalina.out.
  • It is good practice to archive and remove old catalina.out files and other log files out of the ${tomcat_home}/logs directory on a regular basis.

Next Step

Next, we’ll examine the Tomcat Configuration Files and how to modify them for use with the TDS.