Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j properties file - regarding

 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In log4j would Properties loaded in the memory will be updated dynamically whenever the property file gets changed ? This is an application requirement.
Appreciate a response for this.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In log4j would Properties loaded in the memory will be updated dynamically whenever the property file gets changed ? This is an application requirement.


No.
 
Bharathi Balasubramanian
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may able to do this dynamic by getting appenders and modifying through runtime API. If log4j.properties file going to change manually, you can turn-on watch feature (Im not sure what is that called) to update the logger automatic.

If none of this going to work!! You can always write custom wrapper to-do what you want.. That�s the prettiness of open source.


[ October 05, 2004: Message edited by: Bharathi Balasubramanian ]
 
Pavan Panduga
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
take a look at the following method of log4j API.
configureAndWatch(...)


It's available in both PropertyConfigurator and DOMConfigurator.
make sure to do some more research before making use of this option in J2EE environment.

Regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic