pinojs / pino

🌲 super fast, all natural json logger
http://getpino.io
MIT License
14.21k stars 875 forks source link

Consider limiting object traversal depth (was: Add default serializer) #705

Closed ruiaraujo closed 1 year ago

ruiaraujo commented 5 years ago

Currently if the mergingObject is an object with access to things like an Agent instance or other deeply rich objects, pino will try to copy to the output the entire object.

Even though, this can be attributed to programming errors, if one would have a default serializer option for the mergingObject, the user can limit the logging operation on this object.

Another option would be adding a level to which mergingObject will be serialized which for this particular use case would also suffice.

jsumners commented 5 years ago

I do not understand what you are saying. What is "the Agent instance"? Is your desire not solved by https://github.com/pinojs/pino/blob/146d803e6956638861f57d4d46b275aa8c80fa1d/docs/api.md#serializers-object ?

ruiaraujo commented 5 years ago

Not really, due to some programming mistake someone passed in an object using a name that was not in the serializers list.

This object was recursive (which I believe it is handled due to seeing Circular showing up in those logs) and very big and the node process ran out of memory while attempting to log it.

My request is to allow these mistakes to happen without terrible consequences like crashing servers. :smile:

mcollina commented 5 years ago

How would you implement this? I’m not sure I’m following.

ruiaraujo commented 5 years ago

I will take a look at the codebase to see how this could be done.

Fdawgs commented 1 year ago

@ruiaraujo Did you manage to resolve this?

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.