summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-01-30 06:23:58 +0100
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-03 19:49:14 +0000
commit095aaaa639ab57c594bb80bfefbfaed2a2fdff92 (patch)
tree55db4600d1fe284fb591ee810d490b179afe16ad /cmd
parent6ba6ecf59b9204d36388de07b866f157a4d13957 (diff)
downloadpodman-095aaaa639ab57c594bb80bfefbfaed2a2fdff92.tar.gz
podman-095aaaa639ab57c594bb80bfefbfaed2a2fdff92.tar.bz2
podman-095aaaa639ab57c594bb80bfefbfaed2a2fdff92.zip
Allow users to specify logpath
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #135 Approved by: mheon
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/parse.go12
-rw-r--r--cmd/podman/spec.go4
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