mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-04 15:58:39 +00:00
add logpath to docker inspect.
Signed-off-by: Bradley Cicenas <bradley.cicenas@gmail.com>
This commit is contained in:
+5
-3
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user