Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-689

JMX configurator should be able to use MBeanServers with a domain name

    XMLWordPrintable

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 0.9.16
    • None
    • None

    Description

      Currently, logback exposes an MBean to provide logging related controls via the inclusion of the following configuration:
      <jmxConfigurator />

      However, this always uses the platform mbean server:
      MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
      (can be found in class JMXConfiguratorAction, line# 54).

      I think it should be able to provide an option to use an MBeanServer with a specific domain, which is provided in the JMX spec.
      The code needs to use the following:
      List servers = MBeanServerFactory.findMBeanServer(agentId);
      and then use the first one, possibly giving a warning if there are multiple.

      This is crucial for our use-case, especially because we have separate MBeanServers in our web-app environment, and we need each application to use its own MBeanServer with a specific domain.

      So, all in all, can we add an attribute of some sort, so that we can do the following:
      <jmxConfigurator agentid="someMbeanServerId"/>

      and if this is set, the code uses:
      MBeanServer mbs = MBeanServerFactory.findMBeanServer(agentId).get(0);

      and otherwise, it does whatever it used to do.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            celalziftci Celal Ziftci
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: