Skip to content

Commit 261dd3a

Browse files
agam-99claude
authored andcommitted
[GOBBLIN-XXXX] Remove WARN log aggregation from AutomaticTroubleshooter (#4186)
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) <noreply@anthropic.com>
1 parent b3d7059 commit 261dd3a

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

gobblin-modules/gobblin-troubleshooter/src/main/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private void setupLogAppender() {
8484
org.apache.log4j.Logger rootLogger = LogManager.getRootLogger();
8585

8686
troubleshooterLogger = new AutoTroubleshooterLogAppender(issueRepository);
87-
troubleshooterLogger.setThreshold(Level.WARN);
87+
troubleshooterLogger.setThreshold(Level.ERROR);
8888
troubleshooterLogger.activateOptions();
8989
rootLogger.addAppender(troubleshooterLogger);
9090

gobblin-modules/gobblin-troubleshooter/src/test/java/org/apache/gobblin/troubleshooter/AutomaticTroubleshooterTest.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ public void canCollectAndRefineIssues()
4343
AutomaticTroubleshooter troubleshooter = AutomaticTroubleshooterFactory.createForJob(new Properties());
4444
try {
4545
troubleshooter.start();
46-
log.warn("Test warning");
46+
log.error("Test error");
4747

4848
troubleshooter.refineIssues();
4949
troubleshooter.logIssueSummary();
5050

5151
String summaryMessage = troubleshooter.getIssueSummaryMessage();
52-
assertTrue(summaryMessage.contains("Test warning"));
52+
assertTrue(summaryMessage.contains("Test error"));
5353

5454
String detailedMessage = troubleshooter.getIssueDetailsMessage();
55-
assertTrue(detailedMessage.contains("Test warning"));
55+
assertTrue(detailedMessage.contains("Test error"));
5656

5757
EventSubmitter eventSubmitter = mock(EventSubmitter.class);
5858
troubleshooter.reportJobIssuesAsEvents(eventSubmitter);
@@ -72,7 +72,7 @@ public void canDisable()
7272
AutomaticTroubleshooter troubleshooter = AutomaticTroubleshooterFactory.createForJob(properties);
7373
try {
7474
troubleshooter.start();
75-
log.warn("Test warning");
75+
log.error("Test error");
7676

7777
troubleshooter.refineIssues();
7878
troubleshooter.logIssueSummary();
@@ -86,6 +86,22 @@ public void canDisable()
8686
}
8787
}
8888

89+
@Test
90+
public void warnLogsAreNotCaptured()
91+
throws Exception {
92+
AutomaticTroubleshooter troubleshooter = AutomaticTroubleshooterFactory.createForJob(new Properties());
93+
try {
94+
troubleshooter.start();
95+
log.warn("Test warning that should be ignored");
96+
97+
troubleshooter.refineIssues();
98+
99+
assertEquals(0, troubleshooter.getIssueRepository().getAll().size());
100+
} finally {
101+
troubleshooter.stop();
102+
}
103+
}
104+
89105
@Test
90106
public void canDisableEventReporter()
91107
throws Exception {
@@ -96,7 +112,7 @@ public void canDisableEventReporter()
96112
try {
97113
troubleshooter.start();
98114

99-
log.warn("Test warning");
115+
log.error("Test error");
100116

101117
troubleshooter.refineIssues();
102118
troubleshooter.logIssueSummary();

0 commit comments

Comments
 (0)