pino
pino copied to clipboard
prettyPrint does not print child object e.g. x-request-id
ERROR [1623809348111] (my-bar-logger/79874 on MBP-foo): "fake error"
Error: "fake error"
at Object.
with prettyPrint as false json contains x-request-id
{“level”:“error”,“time”:1623809549883,“pid”:80044,“hostname”:“MBP-foo,“name”:“my-bar-logger”,“x-request-id”:“dfc2e009-4309-4a24-b41b-c5183e23a0b2",“stack”:“Error: \“fake error\“\n at Object.
What are we supposed to take away from this report? What is the data causing the error? What is the minimal reproduction case?
When prettyPrint options are set as below e.g. and a child is created e.g. logger.child('somekey': 'some value') this child object/property isn't printed out. Posted prettPrint and json (prettyPrint: false) stack in previous comment to compare where child is set as 'x-request-id' this can be anything, i called out somekeyin this comment. Thanks for looking at this.
const logger = pino({
prettyPrint: { levelFirst: true,
forceColor: true }
})
vs.
const logger = pino({
prettyPrint: false
})
https://stackoverflow.com/help/minimal-reproducible-example
In short: please provide a short script than can be copied, pasted, and run by node index.js.
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.