Skip to content

Commit

Permalink
remove logs longer than memlogd's max-line-len
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
europaul committed Dec 6, 2024
1 parent fae6a11 commit 48dcf52
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion pkg/pillar/agentlog/loglevel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 1 addition & 2 deletions pkg/pillar/cmd/upgradeconverter/applydefaultconfigitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48dcf52

Please sign in to comment.