1

I have a Tomcat7 server and I'd like to move the catalina.out log to a different directory than ${catalina.base}/logs.

  1. The approach of changing CATALINA_OUT environment variable doesn't work How do I change the path to catalina.out?, I've modified it and I'm sure the environment variable is set to CATALINA_OUT="$MY_PATH/catalina.out" before the server startup, but catalina.out stays still in ${catalina.base}/logs

  2. The conf/logging.properties doesn't specify such property for catalina.out, this had been brought up in many similar discussion posts.

Is there any folks also met such problem recently or before ?

陳冠昇
  • 21
  • 3
  • Duplicate: https://stackoverflow.com/questions/33194637/how-do-i-change-the-path-to-catalina-out – swe Oct 28 '19 at 07:36
  • Possible duplicate of [How do I change the path to catalina.out?](https://stackoverflow.com/questions/33194637/how-do-i-change-the-path-to-catalina-out) – swe Oct 28 '19 at 07:37

1 Answers1

0

You could change the Tomcat Log Locations as below:

Go to: <tomcat-base>/conf/logging.properties and replace <add_location_you_prefer> with what you require;

catalina.org.apache.juli.AsyncFileHandler.level = FINE
catalina.org.apache.juli.AsyncFileHandler.directory = <add_location_you_prefer>
catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.

localhost.org.apache.juli.AsyncFileHandler.level = FINE
localhost.org.apache.juli.AsyncFileHandler.directory = <add_location_you_prefer>
localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.

manager.org.apache.juli.AsyncFileHandler.level = FINE
manager.org.apache.juli.AsyncFileHandler.directory = <add_location_you_prefer>
manager.org.apache.juli.AsyncFileHandler.prefix = manager.

host-manager.org.apache.juli.AsyncFileHandler.level = FINE
host-manager.org.apache.juli.AsyncFileHandler.directory = <add_location_you_prefer>
host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.

Lastly you will need to change the catalina.out:

Find the following code snippet in Catalina.sh script in bin directory of your tomcat base location and change the

CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out to:

CATALINA_OUT=<add_location_you_prefer>/catalina.out

Du-Lacoste
  • 11,530
  • 2
  • 71
  • 51