docs: public static void registerLog4jMBeans() throws JMException {
          if (Boolean.getBoolean("zookeeper.jmx.log4j.disable") == true) {
              return;
          }
          
          MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
  
          // Create and Register the top level Log4J MBean
          HierarchyDynamicMBean hdm = new HierarchyDynamicMBean();
  
          ObjectName mbo = new ObjectName("log4j:hiearchy=default");
          mbs.registerMBean(hdm, mbo);
  
          // Add the root logger to the Hierarchy MBean
          Logger rootLogger = Logger.getRootLogger();
          hdm.addLoggerMBean(rootLogger.getName());
  
          // Get each logger from the Log4J Repository and add it to
          // the Hierarchy MBean created above.
          LoggerRepository r = LogManager.getLoggerRepository();
          Enumeration enumer = r.getCurrentLoggers();
          Logger logger = null;
  
          while (enumer.hasMoreElements()) {
             logger = (Logger) enumer.nextElement();
             hdm.addLoggerMBean(logger.getName());
          }
      }