cls-rtracer causes pino-http >= version 7.1 to log success message (responses) twice
See original GitHub issueWhen the cls-rtracer
middleware is added before a logging middleware based on pino-http
>= 7.1.0 the success messages (responses) are logged twice.
The problem happens since the merge of this PR in pino-http
: https://github.com/pinojs/pino-http/pull/219
So after this response event listener was added: res.on('close', onResFinished)
in addition to the already existing one res.on('finish', onResFinished)
For further reference please check the rejected issue at pino-http
: https://github.com/pinojs/pino-http/issues/234
and the sample app to reproduce the issue provided by @Simon-Campbell : https://github.com/Simon-Campbell/pino-http-double-success
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Log formatter getting called twice - intentional? #866 - GitHub
I'm mutating the object being logged (should I not be?) and it's causing some unexpected output. The text was updated successfully, but these ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yup, that’s right. I’m looking into it to provide a proper fix. Just wanted to share a workaround.
Thanks a lot for the very fast fix.