For logging in nestjs I implemented pino as described here: https://github.com/iamolegga/nestjs-pino.
When there is an error throw during the initialization of the nestjs modules, the default nestjs logger is used instead of pino. When the initialization does not throw an error, pino is used correctly.
Maybe the issue occurs because logs are buffered by bufferLogs: true
in main.ts
? And this does not work, if an error is thrown during module init?
Do I maybe have to set the logger before the app is created, as stated here: https://github.com/iamolegga/nestjs-pino/issues/387 (https://github.com/iamolegga/nestjs-pino/issues/125)?