Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LeoNaveen10 opened this issue Mar 1, 2023 · 1 comment
Open

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

LeoNaveen10 opened this issue Mar 1, 2023 · 1 comment

Comments

@LeoNaveen10
Copy link

LeoNaveen10 commented Mar 1, 2023

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
Copy link
Collaborator

mcollina commented Mar 1, 2023

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants