Reputation: 5902
How feasible/practical is it to set system properties at runtime in production environments explicitly? What if there is a web service, that would update system properties - flags mainly. These flags in turn can be used to turn on/off the log-level etc.
The operation would be along these lines:
Any suggestion on this approach? Or is it already common occurrence?
Upvotes: 0
Views: 268
Reputation: 19368
The idea makes some people cringe but does have some appeal... you could store your properties in svn or git and just send out "refresh your config" notifications to the servers via JMS Topic as JB Nizet suggests.
Some nice aspects:
svn blame theconfig.properties
The fact that times and names are associated with every edit can make a nice way to know whose cell phone to set on fire.
Upvotes: 0
Reputation: 691735
I don't see why it wouldn't work, except if your application is clustered across several JVMs. In this case, you'd better store the configuration in a central database or propagate the change to all the other JVMs using a JMS topic, for example.
If you want to make these system properties persistent after a restart, you'd bette store them in a database as well.
Upvotes: 1