From: markt Date: Thu, 3 Sep 2009 14:48:03 +0000 (+0000) Subject: Allow per instance selection of log4j or JULI logging. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ff6f14647e759ff1165ca9c7ff8ea363a0a41e94;p=tomcat7.0 Allow per instance selection of log4j or JULI logging. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@810976 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/RUNNING.txt b/RUNNING.txt index ad1d77fbc..8fd95a5bb 100644 --- a/RUNNING.txt +++ b/RUNNING.txt @@ -104,7 +104,7 @@ When you use $CATALINA_BASE, Tomcat will calculate all relative references for files in the following directories based on the value of $CATALINA_BASE instead of $CATALINA_HOME: -* bin - Only setenv.sh (*nix) and setenv.bat (windows) +* bin - Only setenv.sh (*nix), setenv.bat (windows) and tomcat-juli.jar * conf - Server configuration files (including server.xml) diff --git a/bin/catalina.bat b/bin/catalina.bat index 64672bb56..8ebb900b6 100755 --- a/bin/catalina.bat +++ b/bin/catalina.bat @@ -126,6 +126,15 @@ if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir set CATALINA_TMPDIR=%CATALINA_BASE%\temp :gotTmpdir +rem Add tomcat-juli.jar to classpath +rem tomcat-juli.jar can be over-ridden per instance +if not exist "%CATALINA_BASE%\bin\tomcat-juli.jar" goto juliClasspathHome +set CLASSPATH=%CLASSPATH%;%CATALINA_BASE%\bin\tomcat-juli.jar +goto juliClasspathDone +:juliClasspathHome +set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\tomcat-juli.jar +:juliClasspathDone + if not "%LOGGING_CONFIG%" == "" goto noJuliConfig set LOGGING_CONFIG=-Dnop if not exist "%CATALINA_BASE%\conf\logging.properties" goto noJuliConfig diff --git a/bin/catalina.sh b/bin/catalina.sh index 0a816b0fd..6114e0195 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -168,6 +168,14 @@ if [ -z "$CATALINA_TMPDIR" ] ; then CATALINA_TMPDIR="$CATALINA_BASE"/temp fi +# Add tomcat-juli.jar to classpath +# tomcat-juli.jar can be over-ridden per instance +if [ -r "$CATALINA_BASE/bin/tomcat-juli.jar" ] ; then + CLASSPATH=$CLASSPATH:$CATALINA_BASE/bin/tomcat-juli.jar +else + CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/tomcat-juli.jar +fi + # Bugzilla 37848: When no TTY is available, don't output to console have_tty=0 if [ "`tty`" != "not a tty" ]; then diff --git a/bin/service.bat b/bin/service.bat index 5120c9c4c..3877112d9 100755 --- a/bin/service.bat +++ b/bin/service.bat @@ -112,7 +112,7 @@ rem Each command line option is prefixed with PR_ set PR_DESCRIPTION=Apache Tomcat @VERSION@ Server - http://tomcat.apache.org/ set PR_INSTALL=%EXECUTABLE% set PR_LOGPATH=%CATALINA_BASE%\logs -set PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar +set PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\tomcat-juli.jar rem Set the server jvm from JAVA_HOME set PR_JVM=%JAVA_HOME%\jre\bin\server\jvm.dll if exist "%PR_JVM%" goto foundJvm diff --git a/res/bootstrap.jar.manifest b/res/bootstrap.jar.manifest index 561830cd7..abc53df37 100644 --- a/res/bootstrap.jar.manifest +++ b/res/bootstrap.jar.manifest @@ -1,5 +1,5 @@ Manifest-Version: 1.0 Main-Class: org.apache.catalina.startup.Bootstrap -Class-Path: commons-daemon.jar tomcat-juli.jar tomcat-coyote.jar +Class-Path: commons-daemon.jar tomcat-coyote.jar Specification-Title: Catalina Specification-Version: @VERSION_MAJOR_MINOR@ \ No newline at end of file diff --git a/webapps/docs/logging.xml b/webapps/docs/logging.xml index 91adc491a..fd916489f 100644 --- a/webapps/docs/logging.xml +++ b/webapps/docs/logging.xml @@ -296,7 +296,15 @@ log4j.logger.org.apache.catalina.session=DEBUG
documentation for more options. This page is intended only as a bootstrapping guide.

- + +

+ If you have multiple instances of Tomcat, each with a separate + $CATALINA_HOME but a shared $CATALINA_BASE then + you can configure log4j on a per instance basis by replacing references to + $CATALINA_HOME in the above instructions with + $CATALINA_BASE. Note that you may need to create a + $CATALINA_BASE/lib directory. +