Hapi pino is not generating logs for the events-onPostStop.
Opened this issue · 1 comments
LeoNaveen10 commented
while hapi-pino is perfectly generating logs for server started but for server stop not generating any logs even though those events are enabled by default.
I am attaching hapi-pino registration with server.
const customLevel =process.env.BUILD_ENV == 'stage' || process.env.BUILD_ENV == 'prod'
? 'debug'
: 'trace';
await server.register({
plugin: require('hapi-pino'),
options: {
prettyPrint: false,
logRequestStart: true,
logRequestComplete: true,
redact: ['req.headers', 'res.headers'],
level: customLevel,
},
});
logs for server start is as below.
{"level":30,"time":1677652120597,"pid":22096,"hostname":","created":1677652120297,"started":1677652120587,"host":"","port":1111,"protocol":"http","id":"*:22096:lepar8q1","uri":"http://:1111","address":"::","msg":"server started"}
mcollina commented
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.