Skip to content

Commit 1003d6d

Browse files
authored
Eliminate logspam using filelog monitor
When using a filelog monitor, the top-level `pluginConfig.message` filter provides a limited stream of log events to be checked against the `rules[].pattern`. I thus expect it to be normal for most log events to fail to match the top-level `pluginConfig.message` filter. Such a condition should not trigger a warning-level log message. And in fact such log messages should be suppressed by default, unless `-v=5` or higher is used for troubleshooting/debug purposes.
1 parent 12a8f55 commit 1003d6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/systemlogmonitor/logwatchers/filelog/log_watcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (s *filelogWatcher) watchLoop() {
121121
}
122122
log, err := s.translator.translate(strings.TrimSuffix(line, "\n"))
123123
if err != nil {
124-
klog.Warningf("Unable to parse line: %q, %v", line, err)
124+
klog.V(5).Infof("Unable to parse line: %q, %v", line, err)
125125
continue
126126
}
127127
// Discard messages before start time.

0 commit comments

Comments
 (0)