[Feature Request] Ability to configure bigint serialization
Author: dnechayCreated Nov 12, 2025Updated Jun 30, 2026
Issue description
Atm pino uses safe-stable-stringify that is configured with bigint: true to serialize values when JSON.stringify fails with errors. It can lead to tricky behavior, e.g.:
- https://github.com/pinojs/pino-pretty/issues/633
- if too big number gets logged as "number", it might fail to be correctly parsed in some 3rd party systems (e.g. in logging providers)
Suggestion
It would be nice to have some sort of bigint: replacer | false option in pino configuration, that would:
- when
false: disable any serialization ofbigintand re-throw error fromJSON.stringify, sopinousers are explicitly warned and can decide how to serializebigint - when no value - use some default behavior (now - serializing to "number")
- when custom replacer is provided - use it
Source: pinojs/pino