What problem are you trying to solve?
When a hapi event containing an error is logged by hapi-pino, then those errors are logged with very few context. This is specially true for server logs, where usually the context is provided by the plugin itself through the use of tags:
When the code above is executed, the additional information provided through the use of tags is missing from the log.
{"level":50,"time":1638469266007,"pid":6306,"hostname":"codespaces_02ef33","err":{"type":"Error","message":"Operation failed with error","stack":"Error: Operation failed with error\n at log (/workspaces/hapi-pino-test-sandbox/server-logs-error-test.js:9:76)\n at module.exports.internals.Core._invoke (/workspaces/hapi-pino-test-sandbox/node_modules/@hapi/hapi/lib/core.js:490:40)\n at module.exports.internals.Core._initialize (/workspaces/hapi-pino-test-sandbox/node_modules/@hapi/hapi/lib/core.js:368:24)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)"},"msg":"Operation failed with error"}
{"level":50,"time":1638469266008,"pid":6306,"hostname":"codespaces_02ef33","err":{"type":"Error","message":"Operation failed with error","stack":"Error: Operation failed with error\n at log (/workspaces/hapi-pino-test-sandbox/server-logs-error-test.js:17:76)\n at module.exports.internals.Core._invoke (/workspaces/hapi-pino-test-sandbox/node_modules/@hapi/hapi/lib/core.js:490:40)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at async module.exports.internals.Core._initialize (/workspaces/hapi-pino-test-sandbox/node_modules/@hapi/hapi/lib/core.js:368:13)"},"msg":"Operation failed with error"}
What did you expected?
I expected the tags information to be preserved on server logs.
What problem are you trying to solve? When a hapi event containing an error is logged by hapi-pino, then those errors are logged with very few context. This is specially true for server logs, where usually the context is provided by the plugin itself through the use of tags:
What did you get?
When the code above is executed, the additional information provided through the use of tags is missing from the log.
What did you expected?
I expected the tags information to be preserved on server logs.