diff --git a/cmd/dockerd/daemon_unix.go b/cmd/dockerd/daemon_unix.go index 2561baa774..a88bcccc0c 100644 --- a/cmd/dockerd/daemon_unix.go +++ b/cmd/dockerd/daemon_unix.go @@ -48,6 +48,8 @@ func (cli *DaemonCli) getPlatformRemoteOptions() ([]libcontainerd.RemoteOption, } if cli.Config.Debug { opts = append(opts, libcontainerd.WithLogLevel("debug")) + } else if cli.Config.LogLevel != "" { + opts = append(opts, libcontainerd.WithLogLevel(cli.Config.LogLevel)) } if cli.Config.ContainerdAddr != "" { opts = append(opts, libcontainerd.WithRemoteAddr(cli.Config.ContainerdAddr)) diff --git a/libcontainerd/remote_daemon.go b/libcontainerd/remote_daemon.go index cd2ac1ce4d..07c0ea6bc6 100644 --- a/libcontainerd/remote_daemon.go +++ b/libcontainerd/remote_daemon.go @@ -221,6 +221,11 @@ func (r *remote) startContainerd() error { } args := []string{"--config", configFile} + + if r.Debug.Level != "" { + args = append(args, "--log-level", r.Debug.Level) + } + cmd := exec.Command(binaryName, args...) // redirect containerd logs to docker logs cmd.Stdout = os.Stdout diff --git a/libcontainerd/remote_daemon_linux.go b/libcontainerd/remote_daemon_linux.go index dc59eb8c14..5a46afb89d 100644 --- a/libcontainerd/remote_daemon_linux.go +++ b/libcontainerd/remote_daemon_linux.go @@ -28,9 +28,6 @@ func (r *remote) setDefaults() { if r.Debug.Address == "" { r.Debug.Address = filepath.Join(r.stateDir, debugSockFile) } - if r.Debug.Level == "" { - r.Debug.Level = "info" - } if r.OOMScore == 0 { r.OOMScore = -999 } diff --git a/libcontainerd/remote_daemon_windows.go b/libcontainerd/remote_daemon_windows.go index 89342d7395..69cd1ac30c 100644 --- a/libcontainerd/remote_daemon_windows.go +++ b/libcontainerd/remote_daemon_windows.go @@ -18,9 +18,6 @@ func (r *remote) setDefaults() { if r.Debug.Address == "" { r.Debug.Address = debugPipeName } - if r.Debug.Level == "" { - r.Debug.Level = "info" - } if r.snapshotter == "" { r.snapshotter = "naive" // TODO(mlaventure): switch to "windows" once implemented }