Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions grok_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func main() {
case err := <-serverErrors:
exitOnError(fmt.Errorf("server error: %v", err.Error()))
case err := <-tail.Errors():
if os.IsNotExist(err) {
exitOnError(fmt.Errorf("error reading log lines: %v. use 'fail_on_missing_logfile: false' in the input configuration if you want grok_exporter to start even though the logfile is missing", err))
}
exitOnError(fmt.Errorf("error reading log lines: %v", err.Error()))
case line := <-tail.Lines():
matched := false
Expand Down
3 changes: 0 additions & 3 deletions tailer/fileTailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@ func openLogfile(path string, readall bool, failOnMissingFile bool) (*File, stri
}
file, err := open(abspath)
if err != nil {
if failOnMissingFile && os.IsNotExist(err) {
return nil, "", fmt.Errorf("%v. use 'fail_on_missing_logfile: false' in the input configuration if you want grok_exporter to start even though the logfile is missing", err)
}
if failOnMissingFile || !os.IsNotExist(err) {
return nil, "", err
}
Expand Down