[logback-user] JMX on a WebSphere clustered environment

Christopher.White at bbh.com Christopher.White at bbh.com
Wed May 30 20:50:44 CEST 2012


bump


Thanks,
-Chris




From:   Christopher.White at bbh.com
To:     logback users list <logback-user at qos.ch>
Date:   03/05/2012 02:31 PM
Subject:        [logback-user]  JMX on a WebSphere clustered environment
Sent by:        logback-user-bounces at qos.ch



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 *************************** IMPORTANT 
NOTE*****************************-- The opinions expressed in this message 
and/or any attachments are those of the author and not necessarily those 
of Brown Brothers Harriman & Co., its subsidiaries and affiliates ("BBH"). 
There is no guarantee that this message is either private or confidential, 
and it may have been altered by unauthorized sources without your or our 
knowledge. Nothing in the message is capable or intended to create any 
legally binding obligations on either party and it is not intended to 
provide legal advice. BBH accepts no responsibility for loss or damage 
from its use, including damage from virus. 
********************************************************************************
_______________________________________________
Logback-user mailing list
Logback-user at qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120530/b33f9aa7/attachment.html>


More information about the Logback-user mailing list