Skip to content

Commit

Permalink
Merge pull request moby#48355 from thaJeztah/libcontainer_consolidate…
Browse files Browse the repository at this point in the history
…_defaults_step2

libcontainerd/supervisor: set log-level through the config-file
  • Loading branch information
thaJeztah authored Aug 23, 2024
2 parents d8f079d + abcb9e9 commit 202d9cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions libcontainerd/supervisor/remote_daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ type remote struct {
daemonWaitCh chan struct{}
daemonStartCh chan error
daemonStopCh chan struct{}

// logLevel overrides the containerd logging-level through the --log-level
// command-line option.
logLevel string
}

// Daemon represents a running containerd daemon
Expand Down Expand Up @@ -159,13 +155,8 @@ func (r *remote) startContainerd() error {
if err != nil {
return err
}
args := []string{"--config", cfgFile}

if r.logLevel != "" {
args = append(args, "--log-level", r.logLevel)
}

cmd := exec.Command(binaryName, args...)
cmd := exec.Command(binaryName, "--config", cfgFile)
// redirect containerd logs to docker logs
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down
2 changes: 1 addition & 1 deletion libcontainerd/supervisor/remote_daemon_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func WithLogLevel(lvl string) DaemonOpt {
// so don't pass the default.
lvl = ""
}
r.logLevel = lvl
r.Config.Debug.Level = lvl
return nil
}
}
Expand Down

0 comments on commit 202d9cc

Please sign in to comment.