diff --git a/gobblin-modules/gobblin-troubleshooter/src/main/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterImpl.java b/gobblin-modules/gobblin-troubleshooter/src/main/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterImpl.java index 098799d934b..5759d5256ab 100644 --- a/gobblin-modules/gobblin-troubleshooter/src/main/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterImpl.java +++ b/gobblin-modules/gobblin-troubleshooter/src/main/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterImpl.java @@ -84,7 +84,7 @@ private void setupLogAppender() { org.apache.log4j.Logger rootLogger = LogManager.getRootLogger(); troubleshooterLogger = new AutoTroubleshooterLogAppender(issueRepository); - troubleshooterLogger.setThreshold(Level.WARN); + troubleshooterLogger.setThreshold(Level.ERROR); troubleshooterLogger.activateOptions(); rootLogger.addAppender(troubleshooterLogger); diff --git a/gobblin-modules/gobblin-troubleshooter/src/test/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterTest.java b/gobblin-modules/gobblin-troubleshooter/src/test/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterTest.java index 66c21a872b5..7a914bf904c 100644 --- a/gobblin-modules/gobblin-troubleshooter/src/test/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterTest.java +++ b/gobblin-modules/gobblin-troubleshooter/src/test/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterTest.java @@ -43,16 +43,16 @@ public void canCollectAndRefineIssues() AutomaticTroubleshooter troubleshooter = AutomaticTroubleshooterFactory.createForJob(new Properties()); try { troubleshooter.start(); - log.warn("Test warning"); + log.error("Test error"); troubleshooter.refineIssues(); troubleshooter.logIssueSummary(); String summaryMessage = troubleshooter.getIssueSummaryMessage(); - assertTrue(summaryMessage.contains("Test warning")); + assertTrue(summaryMessage.contains("Test error")); String detailedMessage = troubleshooter.getIssueDetailsMessage(); - assertTrue(detailedMessage.contains("Test warning")); + assertTrue(detailedMessage.contains("Test error")); EventSubmitter eventSubmitter = mock(EventSubmitter.class); troubleshooter.reportJobIssuesAsEvents(eventSubmitter); @@ -72,7 +72,7 @@ public void canDisable() AutomaticTroubleshooter troubleshooter = AutomaticTroubleshooterFactory.createForJob(properties); try { troubleshooter.start(); - log.warn("Test warning"); + log.error("Test error"); troubleshooter.refineIssues(); troubleshooter.logIssueSummary(); @@ -86,6 +86,22 @@ public void canDisable() } } + @Test + public void warnLogsAreNotCaptured() + throws Exception { + AutomaticTroubleshooter troubleshooter = AutomaticTroubleshooterFactory.createForJob(new Properties()); + try { + troubleshooter.start(); + log.warn("Test warning that should be ignored"); + + troubleshooter.refineIssues(); + + assertEquals(0, troubleshooter.getIssueRepository().getAll().size()); + } finally { + troubleshooter.stop(); + } + } + @Test public void canDisableEventReporter() throws Exception { @@ -96,7 +112,7 @@ public void canDisableEventReporter() try { troubleshooter.start(); - log.warn("Test warning"); + log.error("Test error"); troubleshooter.refineIssues(); troubleshooter.logIssueSummary();