FormidableLabs / pino-lambda

Send pino logs to cloudwatch with aws-lambda
MIT License
125 stars 13 forks source link

Custom CloudWach log group and log stream #36

Closed mkovel closed 1 year ago

mkovel commented 1 year ago

Hi, can u help me with one case? How can I configure this module for use it with custom CloudWach log group and log stream? Not only with these that relate to current lambda. Thanks

rdzidziguri commented 1 year ago

Not sure I got your question correctly. This logger works the same way as a regular stdout log meaning the log group you define and attach to your lamda will be used. For log stream. I am not sure you specify it for a good reason, as each log stream means separate lambda execution. There is a reason why this is done the way it is and if everything goes into a single stream there will be a problem with so-called sequenceToken

mkovel commented 1 year ago

@rdzidziguri Thanks for the answer.
I misunderstood initial idea of this package, I got here when I was looking solution for pino that allows write logs not only to stdout but in specific CloudWatch log group/stream (something like that https://github.com/serdnam/pino-cloudwatch-transport) But after some time I returned to this package with additional understanding the goal of this package. Sorry for initial mess. )