summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-11-19 18:15:53 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-11-19 18:15:53 +0100
commit501643c8bde591fcb8e4c42564f1b854128ad2f7 (patch)
tree741fc6b48d1d5fb5e9eeba2d314c06605a324c11 /libpod/runtime.go
parent671e5ee42d4eb71fc0238e8b0b1e4a68b1def156 (diff)
downloadpodman-501643c8bde591fcb8e4c42564f1b854128ad2f7.tar.gz
podman-501643c8bde591fcb8e4c42564f1b854128ad2f7.tar.bz2
podman-501643c8bde591fcb8e4c42564f1b854128ad2f7.zip
Make sure netavark output is logged to the syslog
Create a custom writer which logs the netavark output to logrus. This will log to the syslog when it is enabled. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index c751df79b..1a22cd09a 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -88,6 +88,11 @@ type Runtime struct {
libimageEventsShutdown chan bool
lockManager lock.Manager
+ // syslog describes whenever logrus should log to the syslog as well.
+ // Note that the syslog hook will be enabled early in cmd/podman/syslog_linux.go
+ // This bool is just needed so that we can set it for netavark interface.
+ syslog bool
+
// doRenumber indicates that the runtime should perform a lock renumber
// during initialization.
// Once the runtime has been initialized and returned, this variable is
@@ -517,6 +522,7 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
DefaultSubnet: runtime.config.Network.DefaultSubnet,
IsMachine: runtime.config.Engine.MachineEnabled,
LockFile: filepath.Join(runtime.config.Network.NetworkConfigDir, "netavark.lock"),
+ Syslog: runtime.syslog,
})
if err != nil {
return errors.Wrapf(err, "could not create network interface")