Closed tuliomir closed 2 years ago
This question is not about the current module but about pino configuration. This module just passes all the configuration to the underlying pino-http
, so I'm closing this issue. I suggest to try implement this logic with http-pino
first and ask this question in appropriate module
@iamolegga you point towards the pino-http
direction, while the creators of that package say that this is internally supported pino now, https://github.com/pinojs/pino-http/issues/245#event-7407765140. Can we have any clear answer on this? Thanks
[X] I've read the docs of nestjs-pino
[X] I've read the docs of pino
[X] I couldn't find the same question about nestjs-pino
Question I'm trying to implement a setup where my NestJS application logs all the http requests on the std-out with
trace
level via pino-http and, when the application actively requests a log that is levelinfo
or higher, send a copy of the log to a datadog transport. Not the "agent" kind of interaction, but the one that actually makes a http request for each log to the Datadog API.I have tried many different implementations for this, read the
pino
documentation, tried writing my ownwriteStream
and even tried using the existingpino-datadog
library via their api interface. All without success.I can't identify I'm failing at some basic understanding of NestJS/Pino or if I'm actually facing some bug that I can't understand.
Could someone please point me in a general direction on how to implement this? Maybe a similar project on a public github repo could prove useful.
I'm used to have
winston
handle multiple transports at once, even with local file on some occasions. Not sure if this is the way to think the solution on PinoJS.Thanks in advance.
Please mention other relevant information such as Node.js version and Operating System. I'm using NodeJS
14.15.1
with NestJS7.6.15
, nestjs-pino2.4.0
, pino-http6.4.0
and pino-datadog2.0.2