logger.flush is not a function
magiclen opened this issue · comments
Magic Len (Ron Li) commented
Problem
When setting Fastify's logger option to false
, an error is thrown when Fastify is terminated. The error message is TypeError: logger.flush is not a function
.
Steps to Reproduce
- Set Fastify's logger option to
false
in the configuration. - Start the Fastify app and use ctrl + c to cancel it.
- Observe the error thrown referencing fastify-graceful-shutdown/index.js:45:14.
Dustin Deus commented
We don't expect that someone disables the logger. It is stated in the README that we rely on it. I'd open an issue on fastify. The best solution would be to enable a noop implementation when logger: false
instead of dealing with undefined.