pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alejandro Vilar" <alejandro.vi...@synacom.com.bo>
Subject RE: Help understanding classpaths/codebase with applets
Date Tue, 22 Jun 2010 20:23:15 GMT
Hi John,

I'm not sure if this could be helpful for you(Plan A), but to use a unique
configuration file for Log4j in your wars you could set a system property.
If you are booting tomcat from startup.bat script edit catalina.bat script
and put something like this:

            set JAVA_OPTS=%JAVA_OPTS%
-Dlog4j.configuration="path-to-your-configuration-file"

Or if is running as a service run TOMCAT_PATH/bin/tomca5tw.exe and setup a
system property for your configuration file.
Doing this you can retrieve this property in all your wepApps.

Note that my suggestion is only for Windows OS, I didn't check it in other
platforms but I guess you could do some similar modifications.

(http://logging.apache.org/log4j/1.2/manual.html#defaultInit)

Hope this helps,
Alejandro

-----Original Message-----
From: JohnRodey [mailto:timothyddaly@yahoo.com] 
Sent: Martes, 22 de Junio de 2010 02:47 p.m.
To: user@pivot.apache.org
Subject: Help understanding classpaths/codebase with applets


So I'm still tryin to get Log4j all setup but keep running into road blocks.

Now I'm running into issues where my knowledge of applets is lacking and was
hoping I could find some help.

Plan A) What I would like to do is have one log4j.xml configuration file
stored directly under my tomcat directory (In other words I don't want a
seperate log4j.xml file for each war that I have, I just want them all to
share one config file).  However I don't know how to give my applet access
to something thats not in the directory for the applet.
So directory structure like this:
tomcat
..log4j.xml
..webapps
....mypivotapp
....someotherapp

Plan B) If I can't do (A) then my startup script can make a copy of the
log4j.xml and put it directly in the mypivotapp directory.  Although looks
like by default the applet can't see it there.  Looking into the
codebase_lookup property shows that when this is false applets only use the
jars in their classpath.  Will enabling this help, documentation says that
there is a performance hit for doing so, which leads me to believe there are
better ways.

Plan C) My startup script could import my log4j.xml file into my jar file on
my classpath.  ex. tomcat/webapps/mypivotapp/lib/mylib.jar

The goal is to just need to edit one file to alter all logging.

Thanks!
-- 
View this message in context:
http://apache-pivot-users.399431.n3.nabble.com/Help-understanding-classpaths
-codebase-with-applets-tp914940p914940.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Mime
View raw message