No catalina.out on macOS Sierra

2.1k views Asked by At

I installed Apache Tomcat 8.5.9 using Homebrew on macOS Sierra. When I start the Tomcat server, catalina.out is not created as expected in /usr/local/Cellar/tomcat/8.5.9/libexec/logs.

I have tried:

  • Redirecting the log file to another location using setenv.sh
  • echo "log file location $CATALINA_OUT" in /usr/local/Cellar/tomcat/8.5.9/bin/catalina and it is set to the default location of libexec/logs/catalina.out. After this change, I can see that setenv.sh is modifying this location correctly.
  • Manually creating catalina.out in the default location and granting full privileges

I am seeing other logs like:

  • catalina.[date].log
  • host-manager.[date].log
  • manager.[date].log
  • localhost_access_log.[date].log

The Tomcat server is running fine as in I am able to run my WAR files and use my applications with no problems. None of the other logs indicate a problem creating catalina.out, as I would expect.

1

There are 1 answers

1
heisbrandon On

It seems that Homebrew redirects stdout/stderr which overrides the configuration provided by Tomcat, and by default the configuration for the Tomcat installation in Homebrew does not define a file to log the standard output and error. You can change this by modifying the .plist file for Tomcat.

Find the .plist file in the base directory for the Tomcat installation. The installation was located in /usr/local/Cellar/tomcat@8/8.5.51 for me, but it may vary by Tomcat version. There should be a file in that directory named something similar to [email protected]. Edit that file and add the following lines to the <dict> element:

  <key>StandardOutputPath</key>
  <string>/path/to/catalina.out</string>
  <key>StandardErrorPath</key>
  <string>/path/to/catalina.out</string>

Be careful not to insert the lines between any existing key-value pairs.

I chose to use the catalina.out path Tomcat would have created by default which for me would be /usr/local/Cellar/tomcat@8/8.5.51/libexec/logs/catalina.out.