Author: markt
Date: Fri Nov 27 20:51:03 2009
New Revision: 885002
URL: http://svn.apache.org/viewvc?rev=885002&view=rev
Log:
Allow per instance configuration of JULI or log4j for core Tomcat logging when
using CATALINA_BASE.
Modified:
tomcat/tc6.0.x/trunk/RUNNING.txt
tomcat/tc6.0.x/trunk/bin/catalina.bat
tomcat/tc6.0.x/trunk/bin/catalina.sh
tomcat/tc6.0.x/trunk/bin/service.bat
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
tomcat/tc6.0.x/trunk/webapps/docs/logging.xml
Modified: tomcat/tc6.0.x/trunk/RUNNING.txt
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/RUNNING.txt?rev=885002&r1=885001&r2=885002&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/RUNNING.txt (original)
+++ tomcat/tc6.0.x/trunk/RUNNING.txt Fri Nov 27 20:51:03 2009
@@ -104,7 +104,7 @@
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)
Modified: tomcat/tc6.0.x/trunk/bin/catalina.bat
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/bin/catalina.bat?rev=885002&r1=885001&r2=885002&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/bin/catalina.bat (original)
+++ tomcat/tc6.0.x/trunk/bin/catalina.bat Fri Nov 27 20:51:03 2009
@@ -110,14 +110,6 @@
call "%CATALINA_HOME%\bin\setclasspath.bat" %1
if errorlevel 1 goto end
-rem Add on extra jar file to CLASSPATH
-rem Note that there are no quotes as we do not want to introduce random
-rem quotes into the CLASSPATH
-if "%CLASSPATH%" == "" goto emptyClasspath
-set CLASSPATH=%CLASSPATH%;
-:emptyClasspath
-set CLASSPATH=%CLASSPATH%%CATALINA_HOME%\bin\bootstrap.jar
-
if not "%CATALINA_BASE%" == "" goto gotBase
set CATALINA_BASE=%CATALINA_HOME%
:gotBase
@@ -126,6 +118,21 @@
set CATALINA_TMPDIR=%CATALINA_BASE%\temp
:gotTmpdir
+rem Add tomcat-juli.jar and bootstrap.jar to classpath
+rem tomcat-juli.jar can be over-ridden per instance
+rem Note that there are no quotes as we do not want to introduce random
+rem quotes into the CLASSPATH
+if "%CLASSPATH%" == "" goto emptyClasspath
+set CLASSPATH=%CLASSPATH%;
+:emptyClasspath
+if "%CATALINA_BASE%" == "%CATALINA_HOME%" goto juliClasspathHome
+if not exist "%CATALINA_BASE%\bin\tomcat-juli.jar" goto juliClasspathHome
+set
CLASSPATH=%CLASSPATH%%CATALINA_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\bootstrap.jar
+goto juliClasspathDone
+:juliClasspathHome
+set CLASSPATH=%CLASSPATH%%CATALINA_HOME%\bin\bootstrap.jar
+:juliClasspathDone
+
if not "%LOGGING_CONFIG%" == "" goto noJuliConfig
set LOGGING_CONFIG=-Dnop
if not exist "%CATALINA_BASE%\conf\logging.properties" goto noJuliConfig
Modified: tomcat/tc6.0.x/trunk/bin/catalina.sh
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/bin/catalina.sh?rev=885002&r1=885001&r2=885002&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/bin/catalina.sh (original)
+++ tomcat/tc6.0.x/trunk/bin/catalina.sh Fri Nov 27 20:51:03 2009
@@ -157,14 +157,19 @@
fi
fi
-# Add on extra jar files to CLASSPATH
+if [ -z "$CATALINA_BASE" ] ; then
+ CATALINA_BASE="$CATALINA_HOME"
+fi
+
+# Add tomcat-juli.jar and bootstrap.jar to classpath
+# tomcat-juli.jar can be over-ridden per instance
if [ ! -z "$CLASSPATH" ] ; then
CLASSPATH="$CLASSPATH":
fi
-CLASSPATH="$CLASSPATH""$CATALINA_HOME"/bin/bootstrap.jar
-
-if [ -z "$CATALINA_BASE" ] ; then
- CATALINA_BASE="$CATALINA_HOME"
+if [ "$CATALINA_BASE" != "$CATALINA_HOME" ] && [ -r
"$CATALINA_BASE/bin/tomcat-juli.jar" ] ; then
+
CLASSPATH="$CLASSPATH""$CATALINA_BASE"/bin/tomcat-juli.jar:"$CATALINA_HOME"/bin/bootstrap.jar
+else
+ CLASSPATH="$CLASSPATH""$CATALINA_HOME"/bin/bootstrap.jar
fi
if [ -z "$CATALINA_OUT" ] ; then
Modified: tomcat/tc6.0.x/trunk/bin/service.bat
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/bin/service.bat?rev=885002&r1=885001&r2=885002&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/bin/service.bat (original)
+++ tomcat/tc6.0.x/trunk/bin/service.bat Fri Nov 27 20:51:03 2009
@@ -92,7 +92,7 @@
set PR_DESCRIPTION=Apache Tomcat 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_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\bootstrap.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
Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=885002&r1=885001&r2=885002&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Fri Nov 27 20:51:03 2009
@@ -277,6 +277,10 @@
Add RemoteIpValve, a port of mod_remoteip. Patch provided by Cyrille Le
Clerc. (markt)
</add>
+ <update>
+ Allow per instance configuration of JULI or log4j for core Tomcat
+ logging when using CATALINA_BASE. (markt/kkolinko)
+ </update>
</changelog>
</subsection>
<subsection name="Coyote">
Modified: tomcat/tc6.0.x/trunk/webapps/docs/logging.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/logging.xml?rev=885002&r1=885001&r2=885002&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/logging.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/logging.xml Fri Nov 27 20:51:03 2009
@@ -296,7 +296,15 @@
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>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]