From: fhanik Date: Thu, 5 Mar 2009 00:35:23 +0000 (+0000) Subject: Make LOGGING_CONFIG a variable that you can set, just like all the other script variables X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=264b291d4ba5507af1a4d126d7a4b95975f64842;p=tomcat7.0 Make LOGGING_CONFIG a variable that you can set, just like all the other script variables git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@750258 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/bin/catalina.bat b/bin/catalina.bat index b426d93ef..b3536e504 100755 --- a/bin/catalina.bat +++ b/bin/catalina.bat @@ -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 --------------------------------------- diff --git a/bin/catalina.sh b/bin/catalina.sh index 57206a622..1a905e3ed 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -67,6 +67,11 @@ # 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