Here's what I do, which is a bit different from the Tomcat instructions. I
pretty much ignore #5 in their instructions....
1. Modify $CATALINA_BASE/conf/catalina.properties. Change the single line...
common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar
...to...
common.loader=${catalina.base}/shared,${catalina.base}/shared/*.jar,${catalina.home}/shared,${catalina.home}/shared/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
I usually also modify $CATALINA_HOME/catalina.properties with the following,
but you can skip this step if you never run Tomcat without using a separate
CATALINA_BASE...
common.loader=${catalina.home}/shared,${catalina.home}/shared/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
2. Place log4j.jar and log4j.properties in ${catalina.home}/shared (create
the directory if it doesn't exist). You can always override this per/instance
by placing log4j.properties in ${catalina.base}/shared, but the default one
will always be there and all instances can share log4j.jar from
$CATALINA_HOME. Make sure log4j.properties references ${catalina.base} (as in
Tomcat's' documentation) instead of ${catalina.home}.
3. Replace $CATALINA_HOME/bin/tomcat-juli.jar with tomcat-juli.jar
from "extras" and put tomcat-juli-adapters.jar from "extras" into
$CATALINA_HOME/lib or $CATALINA_HOME/shared
That's about it. Hope I didn't miss anything. I'm kind of doing this from
memory.
Jake
On Thu, 13 Oct 2011 16:49:31 +0200
Peter Magnusson <pet.magnus...@gmail.com> wrote:
Hi,
I have a problem with log4j. Im to set up log4j with tomcat and a basic
setup works fine. Our setup is that we have multiple instances of Tomcat
running on different ports with different $CATALINA_BASE but the same
$CATALINA_HOME, we set this up to be able to start and stop applications
independent from each other.
If i set everything up as described here
http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j (disregard
#5) it works fine, only problem is that all instances of tomcat log to the
same file. This is not what i want, i want each instance of tomcat to log to
its own logfile.
So i changed my setup accordning to #5 here
http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j , but i
cannot get this to work at all. Its not logging anything when its setup like
this.
First of all, is what im trying to achieve even possible ?
If so, any idea what im doing wrong ? How can i troubleshoot this ?
Any ideas are most welcome, thank you!
Best regards
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org