Closed lamualfa closed 3 years ago
I believe you left out the most important part of your question: how streamConnectedToPinoTee
is defined.
Depending on how node-graceful-shutdown
is implemented, it might not be possible to log anything inside that block as the process can only synchronously log. This is a current limit of using streams.. essentially you can't use pino-tee. We are planning to solve this in pino v7 with a new transport mechanism.
pino is a big pain for graceful shutdown even with stdout dest
Problem
I use node-graceful-shutdown to handle shutdown process. But, the log that are called from Shutdown Handler are not recorded in the log file. What's the solution?
Example code
Output when the application is shut down
at first i thought the problem was with
pino
, but the following code works fine with pino-colada:Code
Output
Output when the application is shut down
Environment
v14.15.4
v6.10.0
v0.3.0