From e872c81b0aa42409a17509276c9251efbc582bdf Mon Sep 17 00:00:00 2001 From: Paul Gaiduk Date: Thu, 28 Nov 2024 20:57:07 +0100 Subject: [PATCH] remove logs longer than memlogd's max-line-len Currently memlogd has set a max-line-len of 8192. If the log line is longer than this, it will be truncated. Since we use structured logs for EVE microservices, truncating logs will result in malformed JSON, which is not parseable by newlogd. This commit removes logs that have a potential to be longer than that limit, because they log whole configs that tend to get very long. In future developers should be aware of this limit and avoid logging big chunks of data. Signed-off-by: Paul Gaiduk --- pkg/pillar/agentlog/loglevel.go | 1 - pkg/pillar/cmd/upgradeconverter/applydefaultconfigitem.go | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/pillar/agentlog/loglevel.go b/pkg/pillar/agentlog/loglevel.go index 23d2d9e8fe..a4391db0ec 100644 --- a/pkg/pillar/agentlog/loglevel.go +++ b/pkg/pillar/agentlog/loglevel.go @@ -89,7 +89,6 @@ func handleGlobalConfigImpl(log *base.LogObject, sub pubsub.Subscription, agentN debugOverride bool, allowDefault bool, logger *logrus.Logger) *types.ConfigItemValueMap { level := logrus.InfoLevel gcp := GetGlobalConfig(log, sub) - log.Functionf("handleGlobalConfigImpl: gcp %+v\n", gcp) if debugOverride { level = logrus.TraceLevel log.Functionf("handleGlobalConfigImpl: debugOverride set. set loglevel to debug") diff --git a/pkg/pillar/cmd/upgradeconverter/applydefaultconfigitem.go b/pkg/pillar/cmd/upgradeconverter/applydefaultconfigitem.go index 36c6e0dacd..83bf5918d8 100644 --- a/pkg/pillar/cmd/upgradeconverter/applydefaultconfigitem.go +++ b/pkg/pillar/cmd/upgradeconverter/applydefaultconfigitem.go @@ -38,8 +38,7 @@ func applyDefaultConfigItem(ctxPtr *ucContext) error { // Apply defaults newConfigPtr.UpdateItemValues(oldConfigPtr) if !cmp.Equal(oldConfigPtr, newConfigPtr) { - log.Noticef("Updated ConfigItemValueMap with new defaults. Diff: %+v", - cmp.Diff(oldConfigPtr, newConfigPtr)) + log.Noticef("Updated ConfigItemValueMap with new defaults") } else { log.Tracef("upgradeconverter.applyDefaultConfigItem done with no change") return nil