Make LOGGING_CONFIG a variable that you can set, just like all the other script variables
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 5 Mar 2009 00:35:23 +0000 (00:35 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 5 Mar 2009 00:35:23 +0000 (00:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@750258 13f79535-47bb-0310-9956-ffa450edef68

bin/catalina.bat
bin/catalina.sh

index b426d93..b3536e5 100755 (executable)
@@ -64,6 +64,13 @@ rem
 rem                   -agentlib:jdwp=transport=%JPDA_TRANSPORT%,
 rem                       address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
 rem
+rem   LOGGING_CONFIG  (Optional) Override Tomcat's logging manager and logging config file
+rem                   Example (all one line)
+rem                   set LOGGING_CONFIG=-Djava.util.logging.manager=com.foo.MyLogManager 
+rem                                   -Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties
+rem
+rem
+rem
 rem $Id$
 rem ---------------------------------------------------------------------------
 
@@ -114,9 +121,12 @@ if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
 set CATALINA_TMPDIR=%CATALINA_BASE%\temp
 :gotTmpdir
 
+if not "%LOGGING_CONFIG%" == "" goto noJuli
+set LOGGING_CONFIG=-Dnop
 if not exist "%CATALINA_BASE%\conf\logging.properties" goto noJuli
-set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
+set LOGGING_CONFIG=-Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 :noJuli
+set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
 
 rem ----- Execute The Requested Command ---------------------------------------
 
index 57206a6..1a905e3 100755 (executable)
 #   CATALINA_PID    (Optional) Path of the file which should contains the pid
 #                   of catalina startup java process, when start (fork) is used
 #
+#   LOGGING_CONFIG  (Optional) Override Tomcat's logging manager and logging config file
+#                   Example (all one line)
+#                   LOGGING_CONFIG="-Djava.util.logging.manager=com.foo.MyLogManager \
+#                                   -Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
+#
 # $Id$
 # -----------------------------------------------------------------------------
 
@@ -179,15 +184,16 @@ if $cygwin; then
   JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"`
 fi
 
-# Set juli LogManager if it is present
-if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then
-  JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
-  LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
-else
-  # Bugzilla 45585
-  LOGGING_CONFIG="-Dnop"
+# Set juli LogManager if it is present and an override has not been issued
+if [ -z "$LOGGING_CONFIG" ]; then
+  if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then
+    JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
+    LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
+  else
+    # Bugzilla 45585
+    LOGGING_CONFIG="-Dnop"
+  fi
 fi
-
 # ----- Execute The Requested Command -----------------------------------------
 
 # Bugzilla 37848: only output this if we have a TTY