Quick question: Are you running under a security manager in any environment? 
The 

logs (most likely catalina.out or catalina.<date>.log) will have lots of 
messages 

if you've not modified the default $CATALINA_HOME/conf/catalina.policy file.

For example, if I run my simple application that has its first logging instance 
in a servlet under the security manager using the default catalina.policy, I 
get 
as the first line of the error:

javax.servlet.ServletException: Error instantiating servlet class 
simple.controller.SimpleLog

If you are doing your first logging in a ServletContextListener, your 
application will likely not start at all.

The configuration can get complicated quickly. There should be a policy that 
allows the appropriate log4j class to read its configuration file. There should 
be another policy that allows the appropriate log4j class to read/write in the 
log directory as well as the appropriate log files.

Maybe someone on the list has already written the appropriate catalina.policy 
lines.

If you're not running using the security manager, then please disregard the 
noise.

. . . . just my two cents.

/mde/

----- Original Message ----
From: cpanon <cpa...@yahoo.com>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Thu, December 9, 2010 6:43:39 PM
Subject: Re: deploy log4j

Hello
I agree it should be simple and in the IDE it works fine.  In simple production 
environment on Windows Servers it fails.  In simple production environment on a 
WinXPP it works.  It cant get any more discipline testing than that.  Nothing 
changes other than the deployment OS.  


I am loading an applet and I can synthesize my location as 
codebase+"WEB-INF/classes/log4j.properties but even the working IDE environment 
fails.  I am doing a 
prop.load(getClass().getResourceAsStream(codebase+"WEB-INF/classes/log4j.properties")).


Now neither environment works.  Ideas?




________________________________
From: Christopher Schultz <ch...@christopherschultz.net>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Thu, December 9, 2010 4:37:23 PM
Subject: Re: deploy log4j

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark,

On 12/9/2010 3:44 PM, Mark Eggers wrote:
> I didn't get any errors.

Nor do we: we use log4j for application logging, have log4j.jar in
WEB-INF/lib, have our log4j.properties in
WEB-INF/classes/log4j.properties, and use the following code to
configure our logging system:

        new PropertyConfigurator();

It couldn't be simpler than that if you ask me.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0BTBMACgkQ9CaO5/Lv0PBiZgCfY2ajcRb5kgt5ODC4/hx8UaBW
48kAoK0a1Dq/wxwSsXsVrjNWBJwo0IXc
=eyxa
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to