Merge pull request #8238 from vbatts/vbatts-daemon_timestamps

daemon logging: unifying output and timestamps
Upstream-commit: cb106e74a14a37157b09459965a69c944f9c19f0
Component: engine
This commit is contained in:
Alexandr Morozov
2014-10-16 15:55:49 -07:00
8 changed files with 76 additions and 43 deletions

View File

@ -3,7 +3,7 @@
package main
import (
"log"
"github.com/docker/docker/pkg/log"
)
const CanDaemon = false

View File

@ -3,8 +3,6 @@
package main
import (
"log"
"github.com/docker/docker/builder"
"github.com/docker/docker/builtins"
"github.com/docker/docker/daemon"
@ -12,6 +10,7 @@ import (
_ "github.com/docker/docker/daemon/execdriver/native"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/log"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/signal"
)
@ -60,7 +59,7 @@ func mainDaemon() {
}
}()
// TODO actually have a resolved graphdriver to show?
log.Printf("docker daemon: %s %s; execdriver: %s; graphdriver: %s",
log.Infof("docker daemon: %s %s; execdriver: %s; graphdriver: %s",
dockerversion.VERSION,
dockerversion.GITCOMMIT,
daemonCfg.ExecDriver,

View File

@ -5,13 +5,13 @@ import (
"crypto/x509"
"fmt"
"io/ioutil"
"log"
"os"
"strings"
"github.com/docker/docker/api"
"github.com/docker/docker/api/client"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/log"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/reexec"
"github.com/docker/docker/utils"
@ -104,7 +104,7 @@ func main() {
if err := cli.Cmd(flag.Args()...); err != nil {
if sterr, ok := err.(*utils.StatusError); ok {
if sterr.Status != "" {
log.Println(sterr.Status)
log.Infof("%s", sterr.Status)
}
os.Exit(sterr.StatusCode)
}