Why can't we just automatically persist all fields from payload instead of `persistent_log_fields` setting
Hi! I'm trying to understand the idea behind this limitation to put a set of fields as persistent_log_fields
when we build payload (or Kiev[:]) during the request execution we can expect that all fields in execution stack will accumulate. If the same key used - it is safe to assume that they will be overridden
in this case, payload object serves as a global context which you may expand dynamically during the request
in fact, right now, I need to put all possible values as persistent_log_fields and as they will be in log only if not nil I just add context information where possible - this creates some sort of code smell when I need to list all possible fields in one place
Thanks!
IF you need some fields every time you log an event then yes. you have to use the payload fields whitelisting. But in most cases the Kiev.event(:some_name, here: "any", fields: "you", can: "think, of: 1) is enough :)