Dynamically change log4j.xml

View: New views
3 Messages — Rating Filter:   Alert me  

Dynamically change log4j.xml

by Mohit Anchlia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there a way to dynamically change the logging level of log4j.xml in tomcat?

---------------------------------------------------------------------
To start a new topic, e-mail: users@...
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Dynamically change log4j.xml

by Dominic Mitchell-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 30 Sep 2008, at 17:20, Mohit Anchlia wrote:
> Is there a way to dynamically change the logging level of log4j.xml  
> in tomcat?

Not builtin.  But you can write some code in a servlet to change the  
logging level.  e.g.

   Logger l = Logger.getLogger("com.mycompany");
   l.setLevel(Level.DEBUG);

-Dom

---------------------------------------------------------------------
To start a new topic, e-mail: users@...
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Dynamically change log4j.xml

by Christopher Schultz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Mohit,

Mohit Anchlia wrote:
> Is there a way to dynamically change the logging level of log4j.xml in tomcat?

I wrote a pair of JSPs a long time ago to do this. It requires a 1.2.x
version of log4j, but you can change lots of stuff on the fly. See the
last entry on this page:

http://www.christopherschultz.net/projects/java/

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

iEYEARECAAYFAkjuT40ACgkQ9CaO5/Lv0PAHewCfS+f2aricXJfnQ0LK/RSISnIk
rpQAn0HzV1B8OkFIBMDYFJNm6yAAi1Qw
=oI5Z
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@...
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price!