bin/catalina.sh outputs to a hard-coded filename $CATALINA_BASE/logs/catalina.out. It would be useful to permit the user to be able to override this. To be consistent with other settings, this could be done using an environment variable, eg. CATALINA_LOG. If the environment variable is not specified then the existing filename continues to be used. I have attached a patch along these lines. This patch has been tested in a production environment. (Although Platform and OS are both specified as "All" for this bug, this enhancement only applies to those platform/OS that use catalina.sh (rather than catalina.bat). This looked like several of them, so I picked "All".) ----patch file--------------------------------------------------------- --- catalina.sh 2005-12-09 09:24:59.000000000 +1100 +++ catalina.sh 2005-12-09 09:33:22.000000000 +1100 @@ -39,6 +39,9 @@ # CATALINA_PID (Optional) Path of the file which should contains the pid # of catalina startup java process, when start (fork) is used # +# CATALINA_LOG (Optional) Path of the file which should contains the output +# from catalina. +# # $Id: catalina.sh 345508 2005-11-18 15:54:56Z yoavs $ # ----------------------------------------------------------------------------- @@ -131,6 +134,10 @@ CATALINA_TMPDIR="$CATALINA_BASE"/temp fi +if [ -z "$CATALINA_LOG" ] ; then + CATALINA_LOG="$CATALINA_BASE"/logs/catalina.out +fi + # For Cygwin, switch paths to Windows format before running java if $cygwin; then JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"` @@ -228,7 +235,7 @@ elif [ "$1" = "start" ] ; then shift - touch "$CATALINA_BASE"/logs/catalina.out + touch "$CATALINA_LOG" if [ "$1" = "-security" ] ; then echo "Using Security Manager" shift @@ -240,7 +247,7 @@ -Dcatalina.home="$CATALINA_HOME" \ -Djava.io.tmpdir="$CATALINA_TMPDIR" \ org.apache.catalina.startup.Bootstrap "$@" start \ - >> "$CATALINA_BASE"/logs/catalina.out 2>&1 & + >> "$CATALINA_LOG" 2>&1 & if [ ! -z "$CATALINA_PID" ]; then echo $! > $CATALINA_PID @@ -252,7 +259,7 @@ -Dcatalina.home="$CATALINA_HOME" \ -Djava.io.tmpdir="$CATALINA_TMPDIR" \ org.apache.catalina.startup.Bootstrap "$@" start \ - >> "$CATALINA_BASE"/logs/catalina.out 2>&1 & + >> "$CATALINA_LOG" 2>&1 & if [ ! -z "$CATALINA_PID" ]; then echo $! > $CATALINA_PID
Seems reasonable.
Implemented in Tomcat 6 (r881088), proposed for 5.5.
Implemented in TC 5.5, will be in 5.5.29 onwards. Thank you.