-
Notifications
You must be signed in to change notification settings - Fork 858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error serializer only works on sub err object #895
Comments
Because object inspection is expensive. We merely look for keys that have been configured to have serializers before attempting to apply any serializers. You are welcome to use the |
That makes sense but what doesn't make sense is to be able to define a serializer that actually only works on nested key. It makes the behaviour non consistent. What I was trying to achieve was solely to rename the |
@mcollina sure it does, many thanks! I was just trying to better illustrate what I meant when opening the issue |
Closed by #896 |
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. |
I'm unsure to understand why the
err
serializer option only works with anerr
key and not with all passed errors.I would expect
logger.info(ReferenceError('test'))
to also use the optional serializer passed to pino just likelogger.info({ err: ReferenceError('test') })
does.Hence I would expect this test to pass:
But unfortunately it doesn't. Seem that it still uses the default error serializer rather than the custom one.
Altering the default serializer doesn't help either.
The text was updated successfully, but these errors were encountered: