Tomcat – fedora tomcat log file path

configurationfedoraloggingtomcat

My log file is inside:

kamil@localhost tomcat$ grep "logs/" ./*
./log4j.properties:log4j.appender.R.File=${catalina.home}/logs/tomcat.log

my CATALINA_HOME is

kamil@localhost tomcat$ sudo grep "CATALINA" ./*
...
./tomcat.conf:CATALINA_HOME="/usr/share/tomcat"

that above suggests that my log file is hare, and there it's:

kamil@localhost tomcat$ sudo ls /usr/share/tomcat/logs/ | grep .out
catalina.out

So why can't I start server:

kamil@localhost tomcat$ sudo tomcat start
/usr/sbin/tomcat: line 30: /logs/catalina.out: No such file or directory

Best Answer

Your problem is that $CATALINA_HOME in tomcat.conf is not read by the tomcat-process. And when you start Tomcat it sets its logpath to $CATALINA_HOME/logs/catalina.out which translates to /logs/catalina.out when $CATALINA_HOME is not set.

The Tomcat startup-script is configured to read environment variables from a file called setenv.sh in the bin/ directory.

Make sure that $CATALINA_HOME is set in this file and you should be fine.