mirror of
https://github.com/containers/podman.git
synced 2025-10-17 11:14:40 +08:00
re-open container log files
when following container log files, if the file gets rotated due to something like size limit, re-open it and keep following. Fixes: #8733 Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -73,7 +73,7 @@ func GetLogFile(path string, options *LogOptions) (*tail.Tail, []*LogLine, error
|
||||
Whence: whence,
|
||||
}
|
||||
|
||||
t, err := tail.TailFile(path, tail.Config{MustExist: true, Poll: true, Follow: options.Follow, Location: &seek, Logger: tail.DiscardingLogger})
|
||||
t, err := tail.TailFile(path, tail.Config{MustExist: true, Poll: true, Follow: options.Follow, Location: &seek, Logger: tail.DiscardingLogger, ReOpen: options.Follow})
|
||||
return t, logTail, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user