mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
Add log rotation based on log size
Add new functions to logfile.go for rotating and truncating the events log file once the log file and its contents exceed the maximum size limit while keeping 50% of the log file's content Also add tests to verify log rotation and truncation Signed-off-by: Niall Crowe <nicrowe@redhat.com> Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -13,8 +13,9 @@ import (
|
||||
// newEventer returns an eventer that can be used to read/write events
|
||||
func (r *Runtime) newEventer() (events.Eventer, error) {
|
||||
options := events.EventerOptions{
|
||||
EventerType: r.config.Engine.EventsLogger,
|
||||
LogFilePath: r.config.Engine.EventsLogFilePath,
|
||||
EventerType: r.config.Engine.EventsLogger,
|
||||
LogFilePath: r.config.Engine.EventsLogFilePath,
|
||||
LogFileMaxSize: r.config.Engine.EventsLogFileMaxSize,
|
||||
}
|
||||
return events.NewEventer(options)
|
||||
}
|
||||
|
Reference in New Issue
Block a user