diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-06 05:18:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 05:18:04 +0200 |
commit | f584d47a9d0c050c3b39793a73b0aba17b45e8ba (patch) | |
tree | 56f996fdefdfa8a83f6aba9eb98e6395364f8b60 /libpod/oci_conmon_linux.go | |
parent | ea02d9c2668207523611efac67a1699f776c9147 (diff) | |
parent | 348f2df0c09e2e3b517add5271e6eee583800be3 (diff) | |
download | podman-f584d47a9d0c050c3b39793a73b0aba17b45e8ba.tar.gz podman-f584d47a9d0c050c3b39793a73b0aba17b45e8ba.tar.bz2 podman-f584d47a9d0c050c3b39793a73b0aba17b45e8ba.zip |
Merge pull request #7931 from rhatdan/size
Support max_size logoptions
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r-- | libpod/oci_conmon_linux.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index 1d4f33794..5e73bffe0 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -1352,10 +1352,6 @@ func (r *ConmonOCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, p } args = append(args, "-l", logDriverArg) - if r.logSizeMax >= 0 { - args = append(args, "--log-size-max", fmt.Sprintf("%v", r.logSizeMax)) - } - logLevel := logrus.GetLevel() args = append(args, "--log-level", logLevel.String()) @@ -1363,6 +1359,15 @@ func (r *ConmonOCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, p logrus.Debugf("%s messages will be logged to syslog", r.conmonPath) args = append(args, "--syslog") } + + size := r.logSizeMax + if ctr.config.LogSize > 0 { + size = ctr.config.LogSize + } + if size > 0 { + args = append(args, "--log-size-max", fmt.Sprintf("%v", size)) + } + if ociLogPath != "" { args = append(args, "--runtime-arg", "--log-format=json", "--runtime-arg", "--log", fmt.Sprintf("--runtime-arg=%s", ociLogPath)) } |