[logback-user] JMXConfigurator OName

Anders Engström epirealer at gmail.com
Wed Aug 13 20:33:08 CEST 2008


Unfortunately it looks like my delegating Context-hack in the previous post
doesn't work :)

Looks like the JMXConfiguratorAction uses another(!) Context-instance while
executing the Action rules.

I tried creating a custom Joran Action that registered the MBean with a
namespace - and that worked nicely.

How ever -- it is (IMO) reasonable to expect that the standard
JMXConfiguratorAction would support some way to scope the ObjectName
(without resorting to setting up and managing a ContextSelector for the
app-server).

I've created a patch for JMXConfiguratorAction that allows it to take a
configuration attribute (optional) that will scope the MBean:

<jmxConfigurator namespace="your_custom_tag"/>

This will register the MBean with an ObjectName of
"ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.ConfiguratorMBean,namespace=your_custom_tag".

It is perhaps not the cleanest solution, but at least it provides some way
to control the scoping of the MBean in a multi-application environment.

Let me know if this is a good idea, and I will post the patch to JIRA!

Best Regards //Anders


Anders Engström wrote:
> 
> Hi!
> 
> It would be really nice if the jmxConfigurator action (in logback.xml)
> could be configured with an explicit ObjectName. I'm in the same situation
> as the original poster (we're running multiple instances of the same
> web-application in the same servlet container). 
> 
> Something like:
> 
> 
> <jmxConfigurator objectNameProperty="webapp=someWebApp" />
> 
> 
> This would yield an ObjectName as:
> 'ch.qos.logback.classic:Name=default,webapp=someWebApp'.
> 
> This would allow each web-app to have it's own mbean instance registered
> with the server.
> 
> My choice is either to read up on the Joran configuration API and create a
> custom Action that will do the kind of MBean registration that I need, or
> to do some voodoo in our custom Logback loader. At the moment I'm doing
> some funky stuff in our loader:
> 
> [...]
> 
> 

-- 
View this message in context: http://www.nabble.com/JMXConfigurator-OName-tp18566870p18968701.html
Sent from the Logback User mailing list archive at Nabble.com.



More information about the Logback-user mailing list