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:
- Set up a web service in the live prod application
- access web service [restrict access to specific users] – this would present a UI that would update system properties
- application would use the updated system properties going forward
Any suggestion on this approach? Or is it already common occurrence?
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.