-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
feature requestNew feature to be addedNew feature to be addedgood first issueGood for newcomersGood for newcomers
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
It is possible to pass an existing logger object to the fastify() function. There is a check here that detects if the logger instance is valid.
If a partial logger is passed in, it is currently ignored because that isValidLogger() function returns false. If I pass in an incorrect logger object, it would be more helpful to know that it was rejected rather than silently ignored. I propose throwing if a partially matching logger is provided.
Motivation
I spent a few hours debugging why my logger was not being used. It turns out that pino's child() function is not enumerable, and @fastify/deepmerge only clones enumerable properties. I created a fastify server with the cloned logger, and it was silently ignored because child() was missing.
Example
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestNew feature to be addedNew feature to be addedgood first issueGood for newcomersGood for newcomers