Merge pull request #37419 from thaJeztah/pass_loglevel_to_containerd

Pass log-level to containerd
This commit is contained in:
Sebastiaan van Stijn 2018-07-09 21:59:47 +02:00 committed by GitHub
commit 42bd8e1b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 6 deletions

View file

@ -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))

View file

@ -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

View file

@ -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
}

View file

@ -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
}