iamolegga / nestjs-pino

Platform agnostic logger for NestJS based on Pino with REQUEST CONTEXT IN EVERY LOG
MIT License
1.26k stars 98 forks source link

[BUG] Not Work IN Repl Mode In NESTJS 9~ #1084

Closed Leizhenpeng closed 2 years ago

Leizhenpeng commented 2 years ago

What is the current behavior?

if open repl mode , NestJS standard built-in logger still will work ~

image

What is the expected behavior? Logs will be produced by pino internally

Please provide minimal example repo. Without it this issue will be closed example Please mention other relevant information such as Node.js version and Operating System.

iamolegga commented 2 years ago

@Leizhenpeng is this a limitation of nestjs and this doesn't work with other loggers or this is related only to current lib?

micalevisk commented 2 years ago

@Leizhenpeng this is just how the nestjs REPL behaves and, therefore, a limitation of it:

image

see that there's no chance to replace the logger as the app created by repl() (from @nestjs/core) isn't public (https://github.com/nestjs/nest/blob/a448f53b7746d35bf25a18f1759c971e5b7fea1c/packages/core/repl/repl.ts#L11-L15).

Also, in your code below there's no link between the app and repl(AppModule). I didn't understand why you expected any other behavior

image


I bet you could propose some non-breaking change on that repl at https://github.com/nestjs/nest

There's nothing to do here @iamolegga :)