Make the location of stdout and stderr output configurable. Leave the default as...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 11 Nov 2009 19:51:50 +0000 (19:51 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 11 Nov 2009 19:51:50 +0000 (19:51 +0000)
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

index bb957d7..b8ef5da 100755 (executable)
 #                   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