From e8107e7bb40b241eb0920c4dbb01c342ea3668d7 Mon Sep 17 00:00:00 2001 From: agam-99 Date: Tue, 14 Apr 2026 12:13:42 +0530 Subject: [PATCH] [GOBBLIN-XXXX] Remove WARN log aggregation from AutomaticTroubleshooter Raise the log appender threshold from WARN to ERROR so only ERROR and FATAL logs are aggregated by the troubleshooter. This reduces noise in the issue repository and keeps it focused on actionable errors. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../AutomaticTroubleshooterImpl.java | 2 +- .../AutomaticTroubleshooterTest.java | 26 +++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) 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();