From f5a401d3fe2e8c74e6b6a38e9073b843b16fae68 Mon Sep 17 00:00:00 2001 From: Deng Guangxing Date: Wed, 1 Apr 2015 09:58:07 +0800 Subject: [PATCH] docker info show logging driver info Signed-off-by: Deng Guangxing --- api/client/info.go | 3 +++ daemon/info.go | 1 + docs/man/docker-info.1.md | 1 + docs/sources/reference/commandline/cli.md | 1 + docs/sources/userguide/labels-custom-metadata.md | 1 + integration-cli/docker_cli_info_test.go | 2 +- 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/api/client/info.go b/api/client/info.go index 704351b3dd..0f509d83f9 100644 --- a/api/client/info.go +++ b/api/client/info.go @@ -57,6 +57,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error { if remoteInfo.Exists("ExecutionDriver") { fmt.Fprintf(cli.out, "Execution Driver: %s\n", remoteInfo.Get("ExecutionDriver")) } + if remoteInfo.Exists("LoggingDriver") { + fmt.Fprintf(cli.out, "Logging Driver: %s\n", remoteInfo.Get("LoggingDriver")) + } if remoteInfo.Exists("KernelVersion") { fmt.Fprintf(cli.out, "Kernel Version: %s\n", remoteInfo.Get("KernelVersion")) } diff --git a/daemon/info.go b/daemon/info.go index 824647f8d6..17d56eaf39 100644 --- a/daemon/info.go +++ b/daemon/info.go @@ -79,6 +79,7 @@ func (daemon *Daemon) CmdInfo(job *engine.Job) error { v.SetInt("NGoroutines", runtime.NumGoroutine()) v.Set("SystemTime", time.Now().Format(time.RFC3339Nano)) v.Set("ExecutionDriver", daemon.ExecutionDriver().Name()) + v.Set("LoggingDriver", daemon.defaultLogConfig.Type) v.SetInt("NEventsListener", env.GetInt("count")) v.Set("KernelVersion", kernelVersion) v.Set("OperatingSystem", operatingSystem) diff --git a/docs/man/docker-info.1.md b/docs/man/docker-info.1.md index 346df866ac..a3bbd79828 100644 --- a/docs/man/docker-info.1.md +++ b/docs/man/docker-info.1.md @@ -37,6 +37,7 @@ Here is a sample output: Root Dir: /var/lib/docker/aufs Dirs: 80 Execution Driver: native-0.2 + Logging Driver: json-file Kernel Version: 3.13.0-24-generic Operating System: Ubuntu 14.04 LTS CPUs: 1 diff --git a/docs/sources/reference/commandline/cli.md b/docs/sources/reference/commandline/cli.md index e3344991b5..13ea68ec1c 100644 --- a/docs/sources/reference/commandline/cli.md +++ b/docs/sources/reference/commandline/cli.md @@ -1332,6 +1332,7 @@ For example: Backing Filesystem: extfs Dirs: 545 Execution Driver: native-0.2 + Logging Driver: json-file Kernel Version: 3.13.0-24-generic Operating System: Ubuntu 14.04 LTS CPUs: 1 diff --git a/docs/sources/userguide/labels-custom-metadata.md b/docs/sources/userguide/labels-custom-metadata.md index eb21cc98d4..792c2f505d 100644 --- a/docs/sources/userguide/labels-custom-metadata.md +++ b/docs/sources/userguide/labels-custom-metadata.md @@ -171,6 +171,7 @@ These labels appear as part of the `docker info` output for the daemon: Backing Filesystem: extfs Dirs: 697 Execution Driver: native-0.2 + Logging Driver: json-file Kernel Version: 3.13.0-32-generic Operating System: Ubuntu 14.04.1 LTS CPUs: 1 diff --git a/integration-cli/docker_cli_info_test.go b/integration-cli/docker_cli_info_test.go index 2e8239a4b3..68c24f292d 100644 --- a/integration-cli/docker_cli_info_test.go +++ b/integration-cli/docker_cli_info_test.go @@ -14,7 +14,7 @@ func TestInfoEnsureSucceeds(t *testing.T) { t.Fatalf("failed to execute docker info: %s, %v", out, err) } - stringsToCheck := []string{"Containers:", "Execution Driver:", "Kernel Version:"} + stringsToCheck := []string{"Containers:", "Execution Driver:", "Logging Driver:", "Kernel Version:"} for _, linePrefix := range stringsToCheck { if !strings.Contains(out, linePrefix) {