justtrackio/gosoline

log: Add max fields and max context fields config var

Opened this issue · 0 comments

ss89 commented

Instead of simply fixing an unlikely to happen overflow issue, we should rather limit the amount of fields and context fields on the logger.
We can add a log.max_fields and log.max_context_fields with a sensible default of something like 1024.
Additionally we should log a warning, when someone tries to add more fields than the current limit onto a separate channel logger_max_fields so that it can be filtered easily.