iamolegga / nestjs-pino

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

[QUESTION]How to use in Guards Interceptors... #301

Closed zxchcyc closed 4 years ago

zxchcyc commented 4 years ago

sorry, I am a newbie in nestjs, How to use in Guards Interceptors Pipes Exception filters Middleware, can you provide a demo.

iamolegga commented 4 years ago

Just inject class as you do with any other services in guards, interceptors, pipes, exception filters, middleware. Sometimes you need to use https://docs.nestjs.com/providers#property-based-injection, but in common it's the same as you do it in controllers and services.

For now, I'm closing this question, because it's general and related more to NestJS than this project. But if you are faced with some concrete problems feel free to provide your code here.