Allow per instance selection of log4j or JULI logging.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 3 Sep 2009 14:48:03 +0000 (14:48 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 3 Sep 2009 14:48:03 +0000 (14:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@810976 13f79535-47bb-0310-9956-ffa450edef68

RUNNING.txt
bin/catalina.bat
bin/catalina.sh
bin/service.bat
res/bootstrap.jar.manifest
webapps/docs/logging.xml

index ad1d77f..8fd95a5 100644 (file)
@@ -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)
 
index 64672bb..8ebb900 100755 (executable)
@@ -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
index 0a816b0..6114e01 100755 (executable)
@@ -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
index 5120c9c..3877112 100755 (executable)
@@ -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
index 561830c..abc53df 100644 (file)
@@ -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
index 91adc49..fd91648 100644 (file)
@@ -296,7 +296,15 @@ log4j.logger.org.apache.catalina.session=DEBUG<br />
       documentation</a> for more options. This page is intended only as a
       bootstrapping guide.
     </p>
-        
+
+    <p>
+      If you have multiple instances of Tomcat, each with a separate
+      <code>$CATALINA_HOME</code> but a shared <code>$CATALINA_BASE</code> then
+      you can configure log4j on a per instance basis by replacing references to
+      <code>$CATALINA_HOME</code> in the above instructions with
+      <code>$CATALINA_BASE</code>. Note that you may need to create a
+      <code>$CATALINA_BASE/lib</code> directory. 
+    </p>
   </section>
 
 </body>