You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gregor Schneider <rc...@googlemail.com> on 2009/05/01 11:57:21 UTC
Re: Slightly OT: log4j - generic log4j.dtd
Thing is, that we have multiple boxes (Debian) running with multiple
hosters, so every layout of those boxes is different (i.e. one has
Tomcat in /var/lib, the other one in /usr/local, next one in
/home/apps/tomcat).
Since *some* of our servlets (i.e. our own SSO-mechanism) are runnung
in all boxes, I can't use an absolute path since this one is different
on quite some of those boxes.
Given that usually log4j.xml ist stored in
$CATALINA_HOME/webapps/$app/WEB-IF/classes
I thought of something like
<!DOCTYPE log4j:configuration SYSTEM "../../../../common/classes/log4j.dtd">
That's because our Tomcats are also using log4j instead of Juli.
However, that's close to perfect when using all same Tomcat versions,
but when mixing Tomcat 5.5 and Tomcat 6 on some boxes, this also
doesn't work, since there's no such such as $CATALINA_HOME/common in
Tomcat 6.
Therefore my idea was to use a Java-property being resolved while
pasing log4j.xml, however, the usual meachanism to use Java-properties
inside XML-files doesn't seem to work here.
Actually the property gets resolved perfectly as you can see within
the error-message
log4j:ERROR Could not parse url
[file:/home/tomcat/www/common/classes/log4j.xml].
java.net.MalformedURLException: no protocol: ${log4j.dtd}
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
[ ...some more stuff deleted ]
but the protocol ist the problem.
Oh shit - now that I'm typing I *think* I see the error:
One slash after "file:" seems to be missing... I'll have it changed on
Monday when I'm back in the office to
-Dlog4j.dtd=/${CATALINA_HOME}/common/classes/log4j.dtd \
and will let you guys know if that works.
Cheers
Gregor
--
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available
@ http://pgpkeys.pca.dfn.de:11371
@ http://pgp.mit.edu:11371/
skype:rc46fi
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Slightly OT: log4j - generic log4j.dtd
Posted by André Warnier <aw...@ice-sa.com>.
Gregor Schneider wrote:
since there's no such such as $CATALINA_HOME/common in
Tomcat 6.
You could always create one..
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org