winston-cloudwatch icon indicating copy to clipboard operation
winston-cloudwatch copied to clipboard

Calling 'kthxbye' while an event is being posted will cause events to be missed

Open avnerenv0 opened this issue 5 years ago • 4 comments

Because lib/cloudwatch-integration.js line 20, the callback is called, if this comes from kthkbye, the transport is silently "closed" while events might still be waiting.

avnerenv0 avatar Oct 02 '19 13:10 avnerenv0

kthxbye has been added for scenarios like AWS Lambda, when at a certain point in time you are done and want to just exit.

What is your use case?

lazywithclass avatar Oct 02 '19 14:10 lazywithclass

My use case is a short running Docker container, pretty similar to Lambda. I would also like the process to exit at some point, but I'd like to be sure all the log events have been sent.

avnerenv0 avatar Oct 02 '19 14:10 avnerenv0

Yes you are right, we should not just randomly discard events, I will think of a possibile solution for this.

lazywithclass avatar Oct 02 '19 14:10 lazywithclass

I opened https://github.com/lazywithclass/winston-cloudwatch/pull/118 for this

avnerenv0 avatar Oct 02 '19 15:10 avnerenv0