| Author |
dynamically change log4j logging level
|
Jason Rodrigues
Greenhorn
Joined: Oct 20, 2005
Posts: 21
|
|
Hi is it possible to change the logging levels of log4j without brining down the server ? Do you have any suggestion what i could take a look at or if you have sample code i could look at . we are using jdk 1.4.2 aprpeicate your thoughts -reeve
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
|
|
Are you looking for something like this:
|
[My Blog] [JavaRanch Journal]
|
 |
Jason Rodrigues
Greenhorn
Joined: Oct 20, 2005
Posts: 21
|
|
|
Well i need to do what you mentioned dynamically. That wont work for me. You must have noticed that each time you make a change to the configuration file, you have to restart your application. This can be a little bit cumbersome. I was wondering if there is a dyanmic way of changing the logging levels without restaring the server .
|
 |
Gaurav Bhatia
Ranch Hand
Joined: Jan 01, 2007
Posts: 49
|
|
Using PropertyConfigurator.ConfigureAndWatch() you can enable log4j to watch any changes to the configuration file and apply those changes to the logging at runtime without any restart of the application. Hope that helps Gaurav
|
~Gaurav<br />SCJP5
|
 |
Elie Hirschman
Ranch Hand
Joined: Dec 15, 2005
Posts: 37
|
|
I just came across this article, figured I would share: http://springtips.blogspot.com/2007/07/changing-log4j-logging-levels.html
|
 |
 |
|
|
subject: dynamically change log4j logging level
|
|
|