Skip to content

Commit

Permalink
Set "CompleteLines" true in TailFile (#7158)
Browse files Browse the repository at this point in the history
We've observed with the upgraded tailer, it can observe partial lines.
But we only want complete lines to validate them.
  • Loading branch information
mcpherrinm authored Nov 14, 2023
1 parent de58ad1 commit f57bd30
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/log-validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ func main() {
var tailers []*tail.Tail
for _, filename := range config.Files {
t, err := tail.TailFile(filename, tail.Config{
ReOpen: true,
MustExist: false, // sometimes files won't exist, so we must tolerate that
Follow: true,
Logger: tailLogger{logger},
ReOpen: true,
MustExist: false, // sometimes files won't exist, so we must tolerate that
Follow: true,
Logger: tailLogger{logger},
CompleteLines: true,
})
cmd.FailOnError(err, "failed to tail file")

Expand Down

0 comments on commit f57bd30

Please sign in to comment.