Add log message when tail is added or removed from a file (#4322)
This commit is contained in:
parent
8bf18d6ac7
commit
a10262c5d6
|
@ -203,6 +203,10 @@ func (l *LogParserPlugin) tailNewfiles(fromBeginning bool) error {
|
||||||
Poll: poll,
|
Poll: poll,
|
||||||
Logger: tail.DiscardingLogger,
|
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 {
|
if err != nil {
|
||||||
l.acc.AddError(err)
|
l.acc.AddError(err)
|
||||||
continue
|
continue
|
||||||
|
@ -287,6 +291,10 @@ func (l *LogParserPlugin) Stop() {
|
||||||
|
|
||||||
for _, t := range l.tailers {
|
for _, t := range l.tailers {
|
||||||
err := t.Stop()
|
err := t.Stop()
|
||||||
|
|
||||||
|
//message for a stopped tailer
|
||||||
|
log.Printf("D! tail dropped for file: %v", t.Filename)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("E! Error stopping tail on file %s\n", t.Filename)
|
log.Printf("E! Error stopping tail on file %s\n", t.Filename)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue