dbhowell / pino-cloudwatch

AWS CloudWatch Logs transport for pino
MIT License
38 stars 13 forks source link

Console.log are also logged to CloudWatch #34

Open tgouala opened 4 years ago

tgouala commented 4 years ago

Hello, Is there an option to log to cloudwatch only what is logged with Pino logger ? It seems that my calls to console.log are also logged to CloudWatch.

dbhowell commented 4 years ago

Hello,

Unfortunately this is the 'feature' of Pino, that is the transports are simply taking stdin and sending to CloudWatch. It keeps it simple, which has its drawbacks.

So any console.logs() would be transferred.

You might be able to use console.error() instead of console.log() since it wouldn't go to the stdin of pino-cloudwatch.

Someone may have a better idea though.