Skip to content

Commit 0b9a68d

Browse files
Improve logging for file acquisition (#3778)
* xx * remove redundant file (it's already a log field) --------- Co-authored-by: marco <[email protected]>
1 parent c928a01 commit 0b9a68d

File tree

1 file changed

+3
-0
lines changed
  • pkg/acquisition/modules/file

1 file changed

+3
-0
lines changed

pkg/acquisition/modules/file/file.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ func (f *FileSource) monitorNewFiles(out chan types.Event, t *tomb.Tomb) error {
388388
var ticker *time.Ticker
389389
if f.config.DiscoveryPollEnable {
390390
interval := cmp.Or(f.config.DiscoveryPollInterval, defaultPollInterval)
391+
logger.Infof("File discovery polling enabled with interval: %s", interval)
391392
ticker = time.NewTicker(interval)
392393
tickerChan = ticker.C
393394
defer ticker.Stop()
@@ -502,6 +503,8 @@ func (f *FileSource) setupTailForFile(file string, out chan types.Event, seekEnd
502503
seekInfo.Whence = io.SeekEnd
503504
}
504505

506+
logger.Infof("Starting tail (offset: %d, whence: %d)", seekInfo.Offset, seekInfo.Whence)
507+
505508
tail, err := tail.TailFile(file, tail.Config{
506509
ReOpen: true,
507510
Follow: true,

0 commit comments

Comments
 (0)