From 2ad9dcc07e3062653e3da0c5639a837d3af8b99e Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 22 Jun 2020 15:05:22 -0400 Subject: Set syslog for exit commands on log-level=debug We have a flag, --syslog, for telling logrus to log to syslog as well as to the terminal. Previously, this flag also set the exit command for containers to use `--syslog` (otherwise all output from exit commands is lost). I attempted to replicate this with Podman v2.0, but quickly ran into circular import hell (the flag is defined in cmd/podman, I needed it in cmd/podman/containers, cmd/podman imports cmd/podman/containers already, etc). Instead, let's just set the syslog flag automatically on `--log-level=debug` so we log exit commands automatically when debug-level logs are requested. This is consistent with Conmon and seems to make sense. Signed-off-by: Matthew Heon --- pkg/specgen/specgen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/specgen/specgen.go') diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go index 77b1353c4..03e840ab4 100644 --- a/pkg/specgen/specgen.go +++ b/pkg/specgen/specgen.go @@ -129,7 +129,7 @@ type ContainerBasicConfig struct { Sysctl map[string]string `json:"sysctl,omitempty"` // Remove indicates if the container should be removed once it has been started // and exits - Remove bool `json:"remove"` + Remove bool `json:"remove,omitempty"` } // ContainerStorageConfig contains information on the storage configuration of a -- cgit v1.2.3-54-g00ecf