add logpath to docker inspect.

Signed-off-by: Bradley Cicenas <bradley.cicenas@gmail.com>
This commit is contained in:
Bradley Cicenas
2015-02-18 10:19:52 -05:00
parent 2f024bd9e1
commit 06c01b02f5
6 changed files with 14 additions and 4 deletions
+5 -3
View File
@@ -70,6 +70,7 @@ type Container struct {
ResolvConfPath string
HostnamePath string
HostsPath string
LogPath string
Name string
Driver string
ExecDriver string
@@ -1322,16 +1323,17 @@ func (container *Container) setupWorkingDirectory() error {
func (container *Container) startLoggingToDisk() error {
// Setup logging of stdout and stderr to disk
pth, err := container.logPath("json")
logPath, err := container.logPath("json")
if err != nil {
return err
}
container.LogPath = logPath
if err := container.daemon.LogToDisk(container.stdout, pth, "stdout"); err != nil {
if err := container.daemon.LogToDisk(container.stdout, container.LogPath, "stdout"); err != nil {
return err
}
if err := container.daemon.LogToDisk(container.stderr, pth, "stderr"); err != nil {
if err := container.daemon.LogToDisk(container.stderr, container.LogPath, "stderr"); err != nil {
return err
}
+1
View File
@@ -44,6 +44,7 @@ func (daemon *Daemon) ContainerInspect(job *engine.Job) engine.Status {
out.Set("ResolvConfPath", container.ResolvConfPath)
out.Set("HostnamePath", container.HostnamePath)
out.Set("HostsPath", container.HostsPath)
out.Set("LogPath", container.LogPath)
out.SetJson("Name", container.Name)
out.SetInt("RestartCount", container.RestartCount)
out.Set("Driver", container.Driver)