From 7bf7c177ab3f67d5de1689842204c258fca083e4 Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 27 Mar 2019 13:50:54 -0500 Subject: journald event logging add the ability for podman to read and write events to journald instead of just a logfile. This can be controlled in libpod.conf with the `events_logger` attribute of `journald` or `file`. The default will be set to `journald`. Signed-off-by: baude --- libpod/events/events_linux.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 libpod/events/events_linux.go (limited to 'libpod/events/events_linux.go') diff --git a/libpod/events/events_linux.go b/libpod/events/events_linux.go new file mode 100644 index 000000000..d6898145c --- /dev/null +++ b/libpod/events/events_linux.go @@ -0,0 +1,20 @@ +package events + +import ( + "github.com/pkg/errors" + "strings" +) + +// NewEventer creates an eventer based on the eventer type +func NewEventer(options EventerOptions) (Eventer, error) { + var eventer Eventer + switch strings.ToUpper(options.EventerType) { + case strings.ToUpper(Journald.String()): + eventer = EventJournalD{options} + case strings.ToUpper(LogFile.String()): + eventer = EventLogFile{options} + default: + return eventer, errors.Errorf("unknown event logger type: %s", strings.ToUpper(options.EventerType)) + } + return eventer, nil +} -- cgit v1.2.3-54-g00ecf