
Chris, Would sharing the configuration file by all instances be a possibility? If yes, you could probably get by with the auto-scan feature. -- Ceki http://twitter.com/#!/ceki On 30.05.2012 20:50, Christopher.White@bbh.com wrote:
Hi,
I'm trying to use Logback JMX in my application to allow me to change the configuration at runtime.
I've created client code that can retrieve the JMX bean, and am able to invoke the JMX bean to get/set logging levels.
This works just fine on one single server. However, my application is deployed on a cluster of two servers. When invoking the JMXConfigurator, it only modifies the logging configuration on the particular server that I happened to connect to for that http request, but does not modify the configuration on the other clustered server.
Am I missing something, or is there no way to have one JMX call update the logback configuration on all clustered servers? Am I perhaps retrieving the JMX bean incorrectly for a clustered environment? Any help would be greatly appreciated.
Here is the client code I am using to access the JMX bean:
String contextName = "myContextName"; String objectNameStr = ch.qos.logback.classic.jmx.MBeanUtil.getObjectNameFor(contextName, JMXConfigurator.class); javax.management.ObjectName objectName = new javax.management.ObjectName(objectNameStr); javax.management.MBeanServer mbs = java.lang.management.ManagementFactory.getPlatformMBeanServer(); mbean = javax.management.JMX.newMBeanProxy(mbs, objectName, JMXConfiguratorMBean.class, true); mbean.setLoggerLevel("myLogger", "debug");
Thanks, -Chris