spiegel_podman/cmd/podman/syslog_common.go
Valentin Rothberg 4652a2623f pass --syslog to the cleanup process
The --syslog flag has not been passed to the cleanup process (i.e.,
conmon's exit args) complicating debugging quite a bit.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-20 15:37:07 +02:00

25 lines
498 B
Go

//go:build linux || freebsd
// +build linux freebsd
package main
import (
"log/syslog"
"github.com/containers/podman/v4/cmd/podman/registry"
"github.com/sirupsen/logrus"
logrusSyslog "github.com/sirupsen/logrus/hooks/syslog"
)
func syslogHook() {
if !registry.PodmanConfig().Syslog {
return
}
hook, err := logrusSyslog.NewSyslogHook("", "", syslog.LOG_INFO, "")
if err != nil {
logrus.Debug("Failed to initialize syslog hook: " + err.Error())
} else {
logrus.AddHook(hook)
}
}