diff --git a/internal/pkg/api/handleCheckin.go b/internal/pkg/api/handleCheckin.go index 9603e7957..8df658793 100644 --- a/internal/pkg/api/handleCheckin.go +++ b/internal/pkg/api/handleCheckin.go @@ -1005,14 +1005,13 @@ func parseComponents(zlog zerolog.Logger, agent *model.Agent, req *CheckinReques // Compare the deserialized meta structures and return the bytes to update if different if !reflect.DeepEqual(reqComponents, agent.Components) { + reqComponentsJSON, _ := json.Marshal(*req.Components) zlog.Trace(). - RawJSON("oldComponents", agentComponentsJSON). - RawJSON("newComponents", *req.Components). + Str("oldComponents", string(agentComponentsJSON)). + Str("req.Components", string(reqComponentsJSON)). Msg("local components data is not equal") - zlog.Info(). - RawJSON("req.Components", *req.Components). - Msg("applying new components data") + zlog.Info().Msg("applying new components data") outComponents = *req.Components compUnhealthyReason := calcUnhealthyReason(reqComponents) diff --git a/internal/pkg/server/fleet.go b/internal/pkg/server/fleet.go index cdc5cf074..f61f2941e 100644 --- a/internal/pkg/server/fleet.go +++ b/internal/pkg/server/fleet.go @@ -254,25 +254,17 @@ func configCacheChanged(curCfg, newCfg *config.Config) bool { return curCfg.Inputs[0].Cache != newCfg.Inputs[0].Cache } -func configChangedServer(log zerolog.Logger, curCfg, newCfg *config.Config) bool { - zlog := log.With().Interface("new", newCfg.Redact()).Logger() - +func configChangedServer(zlog zerolog.Logger, curCfg, newCfg *config.Config) bool { changed := true switch { case curCfg == nil: zlog.Info().Msg("initial server configuration") case !reflect.DeepEqual(curCfg.Fleet.CopyNoLogging(), newCfg.Fleet.CopyNoLogging()): - zlog.Info(). - Interface("old", curCfg.Redact()). - Msg("fleet configuration has changed") + zlog.Info().Msg("fleet configuration has changed") case !reflect.DeepEqual(curCfg.Output, newCfg.Output): - zlog.Info(). - Interface("old", curCfg.Redact()). - Msg("output configuration has changed") + zlog.Info().Msg("output configuration has changed") case !reflect.DeepEqual(curCfg.Inputs[0].Server, newCfg.Inputs[0].Server): - zlog.Info(). - Interface("old", curCfg.Redact()). - Msg("server configuration has changed") + zlog.Info().Msg("server configuration has changed") default: changed = false }