Skip to content

Commit

Permalink
Add log message when tail is added or removed from a file (influxdata…
Browse files Browse the repository at this point in the history
  • Loading branch information
maxunt authored and rgitzel committed Oct 17, 2018
1 parent 47970e4 commit b225791
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/inputs/logparser/logparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ func (l *LogParserPlugin) tailNewfiles(fromBeginning bool) error {
Poll: poll,
Logger: tail.DiscardingLogger,
})

//add message saying a new tailer was added for the file
log.Printf("D! tail added for file: %v", file)

if err != nil {
l.acc.AddError(err)
continue
Expand Down Expand Up @@ -287,6 +291,10 @@ func (l *LogParserPlugin) Stop() {

for _, t := range l.tailers {
err := t.Stop()

//message for a stopped tailer
log.Printf("D! tail dropped for file: %v", t.Filename)

if err != nil {
log.Printf("E! Error stopping tail on file %s\n", t.Filename)
}
Expand Down

0 comments on commit b225791

Please sign in to comment.