Swap default logging to journald

This eliminates the concern of log files growing infinitely and also
records all containers for posterity rather then allowing the removal
of a container to destroy the record.

Partially fixes: https://github.com/containers/podman/issues/9158

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2021-04-29 09:16:35 -04:00
parent c1f83da84b
commit ebfe786429
4 changed files with 4 additions and 3 deletions

View File

@ -175,7 +175,7 @@ the container.
Indicates whether the container engine uses MAC(SELinux) container separation via labeling. This option is ignored on disabled systems. Indicates whether the container engine uses MAC(SELinux) container separation via labeling. This option is ignored on disabled systems.
**log_driver**="k8s-file" **log_driver**="journald"
Logging driver for the container. Available options: `k8s-file` and `journald`. Logging driver for the container. Available options: `k8s-file` and `journald`.

View File

@ -283,6 +283,7 @@ var _ = Describe("Config", func() {
gomega.Expect(config.Network.CNIPluginDirs).To(gomega.Equal(pluginDirs)) gomega.Expect(config.Network.CNIPluginDirs).To(gomega.Equal(pluginDirs))
gomega.Expect(config.Engine.NumLocks).To(gomega.BeEquivalentTo(2048)) gomega.Expect(config.Engine.NumLocks).To(gomega.BeEquivalentTo(2048))
gomega.Expect(config.Engine.OCIRuntimes["runc"]).To(gomega.Equal(OCIRuntimeMap["runc"])) gomega.Expect(config.Engine.OCIRuntimes["runc"]).To(gomega.Equal(OCIRuntimeMap["runc"]))
gomega.Expect(config.LogDriver()).To(gomega.Equal("journald"))
}) })
It("should success with valid user file path", func() { It("should success with valid user file path", func() {

View File

@ -157,7 +157,7 @@ default_sysctls = [
# Logging driver for the container. Available options: k8s-file and journald. # Logging driver for the container. Available options: k8s-file and journald.
# #
# log_driver = "k8s-file" # log_driver = "journald"
# Maximum size allowed for the container log file. Negative numbers indicate # Maximum size allowed for the container log file. Negative numbers indicate
# that no size limit is imposed. If positive, it must be >= 8192 to match or # that no size limit is imposed. If positive, it must be >= 8192 to match or

View File

@ -102,7 +102,7 @@ const (
// SystemdCgroupsManager represents systemd native cgroup manager // SystemdCgroupsManager represents systemd native cgroup manager
SystemdCgroupsManager = "systemd" SystemdCgroupsManager = "systemd"
// DefaultLogDriver is the default type of log files // DefaultLogDriver is the default type of log files
DefaultLogDriver = "k8s-file" DefaultLogDriver = "journald"
// DefaultLogSizeMax is the default value for the maximum log size // DefaultLogSizeMax is the default value for the maximum log size
// allowed for a container. Negative values mean that no limit is imposed. // allowed for a container. Negative values mean that no limit is imposed.
DefaultLogSizeMax = -1 DefaultLogSizeMax = -1