diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/parse.go | 12 | ||||
-rw-r--r-- | cmd/podman/spec.go | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/cmd/podman/parse.go b/cmd/podman/parse.go index 33988a3b6..0d1a0b925 100644 --- a/cmd/podman/parse.go +++ b/cmd/podman/parse.go @@ -773,3 +773,15 @@ func stringSlicetoUint32Slice(inputSlice []string) ([]uint32, error) { } return outputSlice, nil } + +func getLoggingPath(opts []string) string { + for _, opt := range opts { + arr := strings.SplitN(opt, "=", 2) + if len(arr) == 2 { + if strings.TrimSpace(arr[0]) == "path" { + return strings.TrimSpace(arr[1]) + } + } + } + return "" +} diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go index a14bd7dfb..d21d8b6da 100644 --- a/cmd/podman/spec.go +++ b/cmd/podman/spec.go @@ -608,6 +608,10 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er if len(c.HostAdd) > 0 { options = append(options, libpod.WithHosts(c.HostAdd)) } + logPath := getLoggingPath(c.LogDriverOpt) + if logPath != "" { + options = append(options, libpod.WithLogPath(logPath)) + } options = append(options, libpod.WithPrivileged(c.Privileged)) return options, nil |