I have the same problem with tomcat 8.5.*
I followed the advice from rod.poli.diniz and did the following:
Created an environment variable in my ~/bash_profile
export CATALINA_LOGS_1=/home/user1/apps/logs/app1
In tomcat <tomcat-base>/bin/setenv.sh
added the following JVM argument that is identified in <tomcat-base>/conf/logging.properties
.
-Dcatalina.logs=$CATALINA_LOGS_1
Then updated <tomcat-base>/conf/logging.properties
.
1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.logs}/catalina
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.logs}/catalina
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.logs}/catalina
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.logs}/catalina
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
Result:
In <tomcat-base>/logs/
:
catalina.out
localhost_access_log.2019-04-12.txt
tomcat.pid
In $CATALINA_LOGS_1
:
catalina.2019-04-12.log
host-manager.2019-04-12.log
localhost.2019-04-12.log
manager.2019-04-12.log
Expected:
In <tomcat-base>/logs/
:
tomcat.pid
In $CATALINA_LOGS_1
:
catalina.out
localhost_access_log.2019-04-12.txt
catalina.2019-04-12.log
host-manager.2019-04-12.log
localhost.2019-04-12.log
manager.2019-04-12.log
Solution:
Update <tomcat-base>/bin/setenv.sh
with the following:
mkdir -p $CATALINA_LOGS_1
CATALINA_OUT=$CATALINA_LOGS_1/catalina.out
Update <tomcat-base>/conf/server.xml
find the AccessLogValve. Replace directory="logs"
: --> directory="${cfrm.logs}"