Closed tcurdt closed 9 months ago
nodejs
v20.11.0
12.1.0
hapi 21.3.3
Maybe this is related? https://github.com/hapijs/hapi-pino/issues/179
I am trying to use hapi-pino to log pretty print log messages to the console.
hapi-pino
const pino = Pino({ transport: { target: 'pino-pretty', options: { colorize: true } } }) return [ { plugin: HapiPino, options: { instance: pino, level: 'info', logPayload: true, logQueryParams: true, logPathParams: true, log4xxResponseErrors: true, } } ]
Unfortunately it seems like the instance gets ignored.
instance
It still just comes out as json:
{"level":30,"time":1707492507295,"pid":78397,"hostname":"foo","created":1707492506898,"started":1707492507295,"host":"foo","port":9000,"protocol":"http","id":"foo:78397:lsesyadu","uri":"http://foo:9000","address":"127.0.0.1","msg":"server started"}
Not sure what happened. After another npm i it seems to work now.
npm i
Runtime
nodejs
Runtime version
v20.11.0
Module version
12.1.0
Used with
hapi 21.3.3
Any other relevant information
Maybe this is related? https://github.com/hapijs/hapi-pino/issues/179
How can we help?
I am trying to use
hapi-pino
to log pretty print log messages to the console.Unfortunately it seems like the
instance
gets ignored.It still just comes out as json: