Closed R0st0s closed 2 years ago
Have you tried using the serializers: https://getpino.io/#/docs/browser?id=serialize-boolean-array?
Thanks for the suggestion, @mcollina! The only drawback is that the serializer are applied on the exactly matching properties, but I can work with that.
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.
How should I go about limiting the length of fields logged with Pino? Let's say I have an object which has one nested field that's 100k characters long, and I want every field to be logged, but up until a specific length, for example 10k characters. I looked into transports, but they didn't really look the perfect fit. I tried to substring the fields myself with
logger.info({ method: request.raw.method, route: request.raw.url, body: JSON.stringify(request.body, replacer), });
But then redaction doesn't work.