Merge pull request #10145 from thaJeztah/cri_startup_logs_step1

pkg/cri/server/base: use structured log for CRI plugin startup and log config as embedded JSON
This commit is contained in:
Maksym Pavlenko 2024-04-29 19:54:39 +00:00 committed by GitHub
commit b3dd6e3860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,7 +99,9 @@ func initCRIRuntime(ic *plugin.InitContext) (interface{}, error) {
StateDir: stateDir, StateDir: stateDir,
} }
log.G(ctx).Infof("Start cri plugin with config %+v", c) // Ignoring errors here; this should never fail.
cfg, _ := json.Marshal(c)
log.G(ctx).WithFields(log.Fields{"config": string(cfg)}).Info("starting cri plugin")
if err := setGLogLevel(); err != nil { if err := setGLogLevel(); err != nil {
return nil, fmt.Errorf("failed to set glog level: %w", err) return nil, fmt.Errorf("failed to set glog level: %w", err)