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:40:15 GMT
Yes, my suggestion is for all wars on the server side, but if the same
config file is required on the client side using a FileSerializer(or a
StreamSerializer) and a get method is enough to send/request the file (using
the same system property to recover the file on the server side) and setup
Log4J as needed.

-----Original Message-----
From: Greg Brown [mailto:gkbrown@mac.com] 
Sent: Martes, 22 de Junio de 2010 04:28 p.m.
To: user@pivot.apache.org
Subject: Re: Help understanding classpaths/codebase with applets

I may be misunderstanding your suggestion, but I think that would only work
for code running on the Tomcat server itself. I believe that John is trying
to use Log4J on the client as well as the server.

On Jun 22, 2010, at 4:23 PM, Alejandro Vilar wrote:

> 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
> Now I'm running into issues where my knowledge of applets is lacking and
> 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
> 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
> better ways.
> Plan C) My startup script could import my log4j.xml file into my jar file
> 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:
> -codebase-with-applets-tp914940p914940.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

View raw message