-
Notifications
You must be signed in to change notification settings - Fork 878
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 question #906
Comments
This will come in handy for the google cloud pino plugin if it ever gets made: googleapis/nodejs-logging#875 (comment) But I would use this config at our org in the meantime. |
This is not currently possible without some significant manipulation of config file. I think you can use the log formatter to do so. |
Ah, so instead of playing with the error serializer, you would suggest something like the following? log(object) {
const stackTraceProp = object?.err?.stack
? {stack_trace: object.err.stack}
: {};
return {
...object,
...stackTraceProp,
}; |
That's the only way to do what you'd like to do. |
Alright thanks! |
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. |
Is it possible to serialize an error
err
such that instead of the stack trace being (only) inerr.stack
it is (also) in a top levelstack_trace
property? If so, how?The text was updated successfully, but these errors were encountered: