A bug in my Hapi H2o2 proxy mapUri function meant a header was being set as undefined and triggered an uncaught error internally in Hapi. This error was logged directly to the console without passing through Pino.
Example log message:
Debug: internal, implementation, error
TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "X-Trace-Id"
at ClientRequest.setHeader (_http_outgoing.js:536:3)
at new ClientRequest (_http_client.js:249:14)
at Object.request (http.js:46:10)
at internals.Client._request (/work/node_modules/@hapi/wreck/lib/index.js:181:28)
at internals.Client.request (/work/node_modules/@hapi/wreck/lib/index.js:75:26)
at /work/node_modules/@hapi/h2o2/lib/index.js:164:45
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async exports.Manager.execute (/work/node_modules/@hapi/hapi/lib/toolkit.js:64:28)
at async Object.internals.handler (/work/node_modules/@hapi/hapi/lib/handler.js:46:20)
at async exports.execute (/work/node_modules/@hapi/hapi/lib/handler.js:31:20)
A bug in my Hapi H2o2 proxy mapUri function meant a header was being set as
undefined
and triggered an uncaught error internally in Hapi. This error was logged directly to the console without passing through Pino.Example log message:
The workaround is to disable Hapi debug mode (https://hapi.dev/api/?v=19.1.1#server.options.debug):
Hapi-Pino should be writing all logs out as JSON without additional server config.
Versions:
@hapi/hapi@19.1.1 hapi-pino@8.0.0