From 0301e4d7bcf7c8f318a67588f30c60013519e748 Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 23 Dec 2020 14:04:32 -0600 Subject: 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 --- libpod/logs/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod') diff --git a/libpod/logs/log.go b/libpod/logs/log.go index d463c0aa4..2637c8524 100644 --- a/libpod/logs/log.go +++ b/libpod/logs/log.go @@ -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 } -- cgit v1.2.3-54-g00ecf