tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37847] New: - Allow User To Optionally Specify Catalina Output File
Date Thu, 08 Dec 2005 23:13:16 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37847>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37847

           Summary: Allow User To Optionally Specify Catalina Output File
           Product: Tomcat 5
           Version: 5.5.13
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: dshaw@avaya.com


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

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message