diff --git a/hbase-logging/src/test/resources/log4j2.properties b/hbase-logging/src/test/resources/log4j2.properties index 67c5670effe..56d67c85aa1 100644 --- a/hbase-logging/src/test/resources/log4j2.properties +++ b/hbase-logging/src/test/resources/log4j2.properties @@ -46,11 +46,13 @@ logger.MetricsConfig.level = WARN logger.MetricsSinkAdapter.name = org.apache.hadoop.metrics2.impl.MetricsSinkAdapter logger.MetricsSinkAdapter.level = WARN +# These two settings are workarounds against spurious logs from the minicluster. +# See HBASE-4709 logger.MetricsSystemImpl.name = org.apache.hadoop.metrics2.impl.MetricsSystemImpl -logger.MetricsSystemImpl.level = WARN +logger.MetricsSystemImpl.level = ERROR logger.MBeans.name = org.apache.hadoop.metrics2.util.MBeans -logger.MBeans.level = WARN +logger.MBeans.level = ERROR logger.directory.name = org.apache.directory logger.directory.level = WARN @@ -68,3 +70,7 @@ logger.RSRpcServices.level = DEBUG logger.TestJul2Slf4j.name = org.apache.hadoop.hbase.logging.TestJul2Slf4j logger.TestJul2Slf4j.level = DEBUG + +# Avoid log flooded with chore execution time, see HBASE-24646 for more details. +logger.ScheduledChore.name = org.apache.hadoop.hbase.ScheduledChore +logger.ScheduledChore.level = INFO diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java index 4c1c1a5be9b..5bf3ae93294 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java @@ -96,7 +96,6 @@ import org.apache.hadoop.hbase.io.hfile.BlockCache; import org.apache.hadoop.hbase.io.hfile.ChecksumUtil; import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.ipc.RpcServerInterface; -import org.apache.hadoop.hbase.logging.Log4jUtils; import org.apache.hadoop.hbase.mapreduce.MapreduceTestingShim; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.RegionState; @@ -631,10 +630,6 @@ public class HBaseTestingUtil extends HBaseZKTestingUtil { createDirsAndSetProperties(); EditLogFileOutputStream.setShouldSkipFsyncForTesting(true); - // Error level to skip some warnings specific to the minicluster. See HBASE-4709 - Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR"); - Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(), - "ERROR"); this.dfsCluster = new MiniDFSCluster(0, this.conf, servers, true, true, true, null, racks, hosts, null); this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster); @@ -656,10 +651,6 @@ public class HBaseTestingUtil extends HBaseZKTestingUtil { public MiniDFSCluster startMiniDFSClusterForTestWAL(int namenodePort) throws IOException { createDirsAndSetProperties(); - // Error level to skip some warnings specific to the minicluster. See HBASE-4709 - Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR"); - Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(), - "ERROR"); dfsCluster = new MiniDFSCluster(namenodePort, conf, 5, false, true, true, null, null, null, null); this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster); @@ -884,9 +875,6 @@ public class HBaseTestingUtil extends HBaseZKTestingUtil { conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, option.getNumRegionServers()); } - // Avoid log flooded with chore execution time, see HBASE-24646 for more details. - Log4jUtils.setLogLevel(org.apache.hadoop.hbase.ScheduledChore.class.getName(), "INFO"); - Configuration c = new Configuration(this.conf); this.hbaseCluster = new SingleProcessHBaseCluster(c, option.getNumMasters(), option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(), diff --git a/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index 9b4fecf41f9..23467d78de5 100644 --- a/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-testing-util/src/main/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -616,11 +616,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { createDirsAndSetProperties(); EditLogFileOutputStream.setShouldSkipFsyncForTesting(true); - // Error level to skip some warnings specific to the minicluster. See HBASE-4709 - Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR"); - Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(), - "ERROR"); - this.dfsCluster = new MiniDFSCluster(0, this.conf, servers, true, true, true, null, racks, hosts, null); this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster); @@ -642,10 +637,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { public MiniDFSCluster startMiniDFSClusterForTestWAL(int namenodePort) throws IOException { createDirsAndSetProperties(); - // Error level to skip some warnings specific to the minicluster. See HBASE-4709 - Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.util.MBeans.class.getName(), "ERROR"); - Log4jUtils.setLogLevel(org.apache.hadoop.metrics2.impl.MetricsSystemImpl.class.getName(), - "ERROR"); dfsCluster = new MiniDFSCluster(namenodePort, conf, 5, false, true, true, null, null, null, null); this.dfsClusterFixer = new FsDatasetAsyncDiskServiceFixer(dfsCluster); @@ -1118,9 +1109,6 @@ public class HBaseTestingUtility extends HBaseZKTestingUtility { conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, option.getNumRegionServers()); } - // Avoid log flooded with chore execution time, see HBASE-24646 for more details. - Log4jUtils.setLogLevel(org.apache.hadoop.hbase.ScheduledChore.class.getName(), "INFO"); - Configuration c = new Configuration(this.conf); this.hbaseCluster = new MiniHBaseCluster(c, option.getNumMasters(), option.getNumAlwaysStandByMasters(), option.getNumRegionServers(), option.getRsPorts(),