hapijs / hapijs/hapi-pino

Hapi pino is not generating logs for the events-onPostStop.

Open
#181 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
147
Forks
56
PR merge metrics
No merged PRs in 30d

Description

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"}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.