summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-21 13:51:51 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-21 20:09:09 +0000
commit152882bf19e1c94110187264ed37d25976bf1e73 (patch)
tree05714e76fa0e96c24c0b8b36f6effd271bc260f4 /libpod/container.go
parent8e76ebcf6e8925d5fa6a8c9ab517d665b44c7b63 (diff)
downloadpodman-152882bf19e1c94110187264ed37d25976bf1e73.tar.gz
podman-152882bf19e1c94110187264ed37d25976bf1e73.tar.bz2
podman-152882bf19e1c94110187264ed37d25976bf1e73.zip
Add ability to retrieve container's log path to API
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #56 Approved by: rhatdan
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go
index 710ae866b..f167adc35 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -150,6 +150,14 @@ func (c *Container) Labels() map[string]string {
return labels
}
+// LogPath returns the path to the container's log file
+// This file will only be present after Init() is called to create the container
+// in runc
+func (c *Container) LogPath() string {
+ // TODO store this in state and allow overriding
+ return c.logPath()
+}
+
// State returns the current state of the container
func (c *Container) State() (ContainerState, error) {
c.lock.Lock()
@@ -181,6 +189,11 @@ func (c *Container) bundlePath() string {
return c.state.RunDir
}
+// The path to the container's logs file
+func (c *Container) logPath() string {
+ return filepath.Join(c.config.StaticDir, "ctr.log")
+}
+
// Retrieves the path of the container's attach socket
func (c *Container) attachSocketPath() string {
return filepath.Join(c.runtime.ociRuntime.socketsDir, c.ID(), "attach")