-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
feature requestNew feature to be addedNew feature to be added
Description
🚀 Feature Proposal
I would like to have the possibility to customize the logger serializer per context so,
in one context I can log a user with the serializerA, and in another context I can use the serializerB.
Pino support the serializers configuration in the child logger, where you can overwrite the serializer defined in the parent logger or simply add new ones.
Motivation
I'm using a JSON schema to drop all the data that I don't want to log out.
In some context I need to see a field with many info, in another context I don't need it
Example
fastify.register(require('./user'), {
logLevel: 'debug',
serializers: {
user: jsonSchemaSerializer(mySchema)
}
})
fastify.register(require('./special-user'), {
logLevel: 'debug',
serializers: {
user: jsonSchemaSerializer(myOtherSchema)
}
})
Metadata
Metadata
Assignees
Labels
feature requestNew feature to be addedNew feature to be added