docs: add serializers documentation - #2494
Open
bilashcse wants to merge 3 commits into
Open
Conversation
jsumners
reviewed
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
docs/serializers.md, a dedicated page documenting the serializer interface, and links it from the docsify sidebar and the README documentation list.Why
Closes #478. As noted there, the docs described the constraints on a serializer (synchronous, returns a JSONifiable value) but never the interface itself. @davidmarkclements suggested a
serializers.mdpage in that thread; this is that page.What it covers
The function signature and the value a serializer receives; that serializers apply to own top-level keys of the merging object and are skipped when the value is
undefined; theerrorKey/errfallback; serializing the message viamessageKey; child logger inheritance and override; a pointer topino.stdSerializers; and thatSymbol.for('pino.*')is deprecated in favour offormatters.log.Behaviour described is taken from
lib/tools.js(L166-173, L203-204),lib/proto.js(L115-136) andpino.js(L111-113).Documentation only, no code changes.