diff --git a/common/docs/containers.conf.5.md b/common/docs/containers.conf.5.md index 638c393d25..b35f340cc9 100644 --- a/common/docs/containers.conf.5.md +++ b/common/docs/containers.conf.5.md @@ -378,6 +378,10 @@ Environment variables to be used when running the container engine (e.g., Podman Note these environment variables will not be used within the container. Set the env section under [containers] table, if you want to set environment variables for the container. +**events_logfile_path**="" + +Define where event logs will be stored, when events_logger is "file". + **events_logger**="journald" Default method to use when logging events. diff --git a/common/pkg/config/config_test.go b/common/pkg/config/config_test.go index 812e1c9308..14f2c42161 100644 --- a/common/pkg/config/config_test.go +++ b/common/pkg/config/config_test.go @@ -346,6 +346,7 @@ image_copy_tmp_dir="storage"` gomega.Expect(config.Engine.EventsLogger).To(gomega.BeEquivalentTo("file")) gomega.Expect(config.Containers.LogDriver).To(gomega.BeEquivalentTo("k8s-file")) } + gomega.Expect(config.Engine.EventsLogFilePath).To(gomega.BeEquivalentTo(config.Engine.TmpDir + "/events/events.log")) }) @@ -380,6 +381,7 @@ image_copy_tmp_dir="storage"` gomega.Expect(config.Containers.LogSizeMax).To(gomega.Equal(int64(100000))) gomega.Expect(config.Engine.ImageParallelCopies).To(gomega.Equal(uint(10))) gomega.Expect(config.Engine.ImageDefaultFormat).To(gomega.Equal("v2s2")) + gomega.Expect(config.Engine.EventsLogFilePath).To(gomega.BeEquivalentTo("/tmp/events.log")) path, err := config.ImageCopyTmpDir() gomega.Expect(err).To(gomega.BeNil()) gomega.Expect(path).To(gomega.BeEquivalentTo("/tmp/foobar")) diff --git a/common/pkg/config/containers.conf b/common/pkg/config/containers.conf index 4e8ad21f8b..10a65437f4 100644 --- a/common/pkg/config/containers.conf +++ b/common/pkg/config/containers.conf @@ -351,6 +351,9 @@ default_sysctls = [ # #env = [] +# Define where event logs will be stored, when events_logger is "file". +#events_logfile_path="" + # Selects which logging mechanism to use for container engine events. # Valid values are `journald`, `file` and `none`. # diff --git a/common/pkg/config/testdata/containers_override.conf b/common/pkg/config/testdata/containers_override.conf index cde9d3d85d..563847158d 100644 --- a/common/pkg/config/testdata/containers_override.conf +++ b/common/pkg/config/testdata/containers_override.conf @@ -9,6 +9,7 @@ log_size_max = 100000 image_parallel_copies=10 image_default_format="v2s2" image_copy_tmp_dir="/tmp/foobar" +events_logfile_path = "/tmp/events.log" [secrets] driver = "pass"