@Test
  public void test() {
    org.apache.logging.log4j.Logger zk =
      org.apache.logging.log4j.LogManager.getLogger("org.apache.zookeeper");
    org.apache.logging.log4j.Level zkLevel = zk.getLevel();
    org.apache.logging.log4j.Logger hbaseZk =
      org.apache.logging.log4j.LogManager.getLogger("org.apache.hadoop.hbase.zookeeper");
    org.apache.logging.log4j.Level hbaseZkLevel = hbaseZk.getLevel();
    org.apache.logging.log4j.Logger client =
      org.apache.logging.log4j.LogManager.getLogger("org.apache.hadoop.hbase.client");
    org.apache.logging.log4j.Level clientLevel = client.getLevel();
    Log4jUtils.disableZkAndClientLoggers();
    assertEquals(org.apache.logging.log4j.Level.OFF, zk.getLevel());
    assertEquals(org.apache.logging.log4j.Level.OFF.toString(),
      Log4jUtils.getEffectiveLevel(zk.getName()));
    assertEquals(org.apache.logging.log4j.Level.OFF, hbaseZk.getLevel());
    assertEquals(org.apache.logging.log4j.Level.OFF.toString(),
      Log4jUtils.getEffectiveLevel(hbaseZk.getName()));
    assertEquals(org.apache.logging.log4j.Level.OFF, client.getLevel());
    assertEquals(org.apache.logging.log4j.Level.OFF.toString(),
      Log4jUtils.getEffectiveLevel(client.getName()));
    // restore the level
    org.apache.logging.log4j.core.config.Configurator.setLevel(zk.getName(), zkLevel);
    org.apache.logging.log4j.core.config.Configurator.setLevel(hbaseZk.getName(), hbaseZkLevel);
    org.apache.logging.log4j.core.config.Configurator.setLevel(client.getName(), clientLevel);
  }
This should be in the hbase-logging module but the {@link HBaseClassTestRule} is in hbase-common
so we can only put the class in hbase-common module for now...
hbase-common/src/test/java/org/apache/hadoop/hbase/logging/TestLog4jUtils.java