Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3070

Not Able to Change Zookeeper Logging via JMX Call

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Blocker
    • Resolution: Not A Problem
    • 3.4.5
    • 3.4.5
    • jmx
    • None
    • Using Java 8 for writing standalone code to update the MBeans in zookeeper which is running in Windows machine for POC purpose.

      Zookeeper Version is : 3.4.5

    Description

      Hi,

      I wanted to change the logging level of zookeeper dynamically via a JMX call programmatically. Apache Zookeeper official page specifies that it is possible to change the Mbeans via JMX calls and I have verified this through JConsole also.

      But the problem is that I am not able to update the Mbeans related to log4j through my code. I do see an API which can be used to access the Mbeans related to Object "org.apache.ZooKeeperService:name0=StandaloneServer_port-1" below is the screengrab of Jconsole and my code:

       

      Here goes my Code:

      public static void main(String[] args) throws Exception

      Unknown macro: { JMXServiceURL url = new JMXServiceURL("service}

       

       

      I dont see any API which can be used to access and update the log4J Mbeans e.g. "root". What I want to achieve is to update the logging of zookeeper without taking a restart.

      Please advice if some API is exposed to achieve this. 

      Attachments

        1. zkpg.JPG
          106 kB
          jahar
        2. jconsole.JPG
          151 kB
          jahar

        Activity

          People

            Unassigned Unassigned
            jahar.tyagi jahar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: