You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mohit Anchlia <mo...@gmail.com> on 2008/09/30 18:20:47 UTC

Dynamically change log4j.xml

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

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


Re: Dynamically change log4j.xml

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----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@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Dynamically change log4j.xml

Posted by Dominic Mitchell <do...@semantico.com>.
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@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org