lazywithclass / winston-cloudwatch

Send logs to Amazon Cloudwatch using Winston.
MIT License
258 stars 104 forks source link

Include CloudWatch event limits #138

Closed ghmeier closed 3 years ago

ghmeier commented 3 years ago

According to their documentation, "the maximum batch size is 1,048,576 bytes. This size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event." Currently we only include the first part of size calculation. This means that any batch with more than 1868 messages will fail with an invalid parameter error because we only allow 48,576 extra bytes. Now, we'll allow you to send batches with any number of events as long as they pass AWS's limits.

ghmeier commented 3 years ago

Hi @lazywithclass, first time contributing here. Let me know if there are any changes you'd like to the PR. It seems like a pretty straightforward patch version change, but I'm definitely less familiar with the code here than you 👍

lazywithclass commented 3 years ago

Hi @ghmeier thanks for the time writing this, I'm busier than usual as I've started university. I will review your code in the weekend.

ghmeier commented 3 years ago

Sounds fine, let me know if there's anything I can do to help ya.

lazywithclass commented 3 years ago

Thanks for this and sorry for the huge delay.

Please find it in version 2.4.0