summaryrefslogtreecommitdiff
path: root/libpod/network/netavark/network.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/network/netavark/network.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/network/netavark/network.go')
-rw-r--r--libpod/network/netavark/network.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/network/netavark/network.go b/libpod/network/netavark/network.go
index cc6fb423c..540d8d6e5 100644
--- a/libpod/network/netavark/network.go
+++ b/libpod/network/netavark/network.go
@@ -37,6 +37,10 @@ type netavarkNetwork struct {
// isMachine describes whenever podman runs in a podman machine environment.
isMachine bool
+ // syslog describes whenever the netavark debbug output should be log to the syslog as well.
+ // This will use logrus to do so, make sure logrus is set up to log to the syslog.
+ syslog bool
+
// lock is a internal lock for critical operations
lock lockfile.Locker
@@ -68,6 +72,10 @@ type InitConfig struct {
// LockFile is the path to lock file.
LockFile string
+
+ // Syslog describes whenever the netavark debbug output should be log to the syslog as well.
+ // This will use logrus to do so, make sure logrus is set up to log to the syslog.
+ Syslog bool
}
// NewNetworkInterface creates the ContainerNetwork interface for the netavark backend.
@@ -122,6 +130,7 @@ func NewNetworkInterface(conf InitConfig) (types.ContainerNetwork, error) {
defaultSubnet: defaultNet,
isMachine: conf.IsMachine,
lock: lock,
+ syslog: conf.Syslog,
}
return n, nil