瀏覽代碼

File acquisition: log "file reopen" events instead of writing to stderr (#2139)

mmetc 2 年之前
父節點
當前提交
d769fff1e8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pkg/acquisition/modules/file/file.go

+ 1 - 1
pkg/acquisition/modules/file/file.go

@@ -310,7 +310,7 @@ func (f *FileSource) StreamingAcquisition(out chan types.Event, t *tomb.Tomb) er
 			continue
 		}
 
-		tail, err := tail.TailFile(file, tail.Config{ReOpen: true, Follow: true, Poll: true, Location: &tail.SeekInfo{Offset: 0, Whence: io.SeekEnd}})
+		tail, err := tail.TailFile(file, tail.Config{ReOpen: true, Follow: true, Poll: true, Location: &tail.SeekInfo{Offset: 0, Whence: io.SeekEnd}, Logger: log.NewEntry(log.StandardLogger())})
 		if err != nil {
 			f.logger.Errorf("Could not start tailing file %s : %s", file, err)
 			continue