Closed stgleb closed 6 years ago
Resolved
t, err := tail.TailFile(logFile, tail.Config{
Location: &tail.SeekInfo{
Offset: 0,
Whence: os.SEEK_END,
},
Follow: true,
})
I also set ReOpen to true. I'm not sure if that applies to your use case. Note that I'm reading log files, so I use SeekEnd as well.
tail.Config{Follow: true, ReOpen: true, Location: &tail.SeekInfo{Offset: 0, Whence: io.SeekEnd}})
I've got a log file that is continuously updated. I want to read the entire file content that exists at the moment and continue with
tail -f
of this file. Which configuration do I need to do so?