summaryrefslogtreecommitdiff
path: root/libpod/events/events_linux.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-03-27 13:50:54 -0500
committerbaude <bbaude@redhat.com>2019-04-24 16:00:04 -0500
commit7bf7c177ab3f67d5de1689842204c258fca083e4 (patch)
tree960fd1365913209fec61e3226b96a6f8bb1fd051 /libpod/events/events_linux.go
parentd75543fcd2ce87a9b87b8883400f355979004e91 (diff)
downloadpodman-7bf7c177ab3f67d5de1689842204c258fca083e4.tar.gz
podman-7bf7c177ab3f67d5de1689842204c258fca083e4.tar.bz2
podman-7bf7c177ab3f67d5de1689842204c258fca083e4.zip
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 <bbaude@redhat.com>
Diffstat (limited to 'libpod/events/events_linux.go')
-rw-r--r--libpod/events/events_linux.go20
1 files changed, 20 insertions, 0 deletions
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
+}