tail icon indicating copy to clipboard operation
tail copied to clipboard

log rotate loss log, tail not stop or kill, why deleted signal lost[hpcloud/tail v1.0.0]

Open wl-lei opened this issue 1 year ago • 0 comments

Describe the bug I’ve encountered an intermittent issue with log collection loss during log rotation when using the [hpcloud/tail v1.0.0] library, tail is not stop or kill. I’ve reviewed previous issues, namely issue 94[https://github.com/hpcloud/tail/issues/94] and issue 97[https://github.com/hpcloud/tail/issues/97], and after analyzing the source code of tail, I’m unable to consistently reproduce the problem. I don’t understand how the ‘deleted’ signal could be getting lost. The configuration for tail is as follows, using the polling mechanism: tailFile, err := tail.TailFile(logPath, tail.Config{ ReOpen: true, Follow: true, Location: &tail.SeekInfo{Offset: 0, Whence: 2}, MustExist: false, Poll: true, })

Expected behaviour I’m wondering if the nxadm/tail has addressed this issue, and I would appreciate it if the experts could help explain the above-mentioned problem.

wl-lei avatar Jul 04 '24 11:07 wl-lei