Skip to content

Commit b3dd6e3

Browse files
author
Maksym Pavlenko
authored
Merge pull request containerd#10145 from thaJeztah/cri_startup_logs_step1
pkg/cri/server/base: use structured log for CRI plugin startup and log config as embedded JSON
2 parents 7cd7a5c + 8a8c3e2 commit b3dd6e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/cri/runtime/plugin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ func initCRIRuntime(ic *plugin.InitContext) (interface{}, error) {
9999
StateDir: stateDir,
100100
}
101101

102-
log.G(ctx).Infof("Start cri plugin with config %+v", c)
102+
// Ignoring errors here; this should never fail.
103+
cfg, _ := json.Marshal(c)
104+
log.G(ctx).WithFields(log.Fields{"config": string(cfg)}).Info("starting cri plugin")
103105

104106
if err := setGLogLevel(); err != nil {
105107
return nil, fmt.Errorf("failed to set glog level: %w", err)

0 commit comments

Comments
 (0)