libpod: make conmon always log to syslog

Conmon very early dups the std streams with /dev/null, therefore all
errors it reports go nowhere. When you run podman with debug level we
set --syslog and we can see the error in the journal. This should be
the default. We have a lot of weird failures in CI that could be caused
by conmon and we have access to the journal in the cirrus tasks so that
should make debugging much easier.

Conmon still uses the same logging level as podman so it will not spam
the journal and only log warning and errors by default.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger 2023-06-14 13:45:22 +02:00
parent d7b72f4368
commit 13c2aca219
No known key found for this signature in database
GPG Key ID: EB145DD938A3CAF2
1 changed files with 2 additions and 4 deletions

View File

@ -1387,10 +1387,8 @@ func (r *ConmonOCIRuntime) sharedConmonArgs(ctr *Container, cuuid, bundlePath, p
logLevel := logrus.GetLevel()
args = append(args, "--log-level", logLevel.String())
if logLevel == logrus.DebugLevel {
logrus.Debugf("%s messages will be logged to syslog", r.conmonPath)
args = append(args, "--syslog")
}
size := r.logSizeMax
if ctr.config.LogSize > 0 {