From 9d30019a16012bf30656c171e35bb7ebc14164c4 Mon Sep 17 00:00:00 2001 From: fhanik Date: Wed, 11 Nov 2009 19:51:50 +0000 Subject: [PATCH] Make the location of stdout and stderr output configurable. Leave the default as it always has been. Currently, one can reconfigure the location of all logfiles except this one. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@835036 13f79535-47bb-0310-9956-ffa450edef68 --- bin/catalina.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/catalina.sh b/bin/catalina.sh index bb957d751..b8ef5da4e 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -26,6 +26,10 @@ # of a Catalina installation. If not present, resolves to # the same directory that CATALINA_HOME points to. # +# CATALINA_OUT (Optional) Full path to a file where stdout and stderr +# will be redirected. +# Default is $CATALINA_BASE/logs/catalina.out +# # CATALINA_OPTS (Optional) Java runtime options used when the "start", # or "run" command is executed. # @@ -163,6 +167,10 @@ if [ -z "$CATALINA_BASE" ] ; then CATALINA_BASE="$CATALINA_HOME" fi +if [ -z "$CATALINA_OUT" ] ; then + CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out +fi + if [ -z "$CATALINA_TMPDIR" ] ; then # Define the java.io.tmpdir to use for Catalina CATALINA_TMPDIR="$CATALINA_BASE"/temp @@ -307,7 +315,7 @@ elif [ "$1" = "start" ] ; then fi shift - touch "$CATALINA_BASE"/logs/catalina.out + touch "$CATALINA_OUT" if [ "$1" = "-security" ] ; then if [ $have_tty -eq 1 ]; then echo "Using Security Manager" @@ -321,7 +329,7 @@ elif [ "$1" = "start" ] ; then -Dcatalina.home="$CATALINA_HOME" \ -Djava.io.tmpdir="$CATALINA_TMPDIR" \ org.apache.catalina.startup.Bootstrap "$@" start \ - >> "$CATALINA_BASE"/logs/catalina.out 2>&1 & + >> "$CATALINA_OUT" 2>&1 & else "$_RUNJAVA" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \ @@ -330,7 +338,7 @@ elif [ "$1" = "start" ] ; then -Dcatalina.home="$CATALINA_HOME" \ -Djava.io.tmpdir="$CATALINA_TMPDIR" \ org.apache.catalina.startup.Bootstrap "$@" start \ - >> "$CATALINA_BASE"/logs/catalina.out 2>&1 & + >> "$CATALINA_OUT" 2>&1 & fi -- 2.11.0