maxbanton / cwh

Amazon Web Services CloudWatch Logs Handler for Monolog library
MIT License
417 stars 83 forks source link

Flush the record buffer before the timespan of all records exceeds 24 hours #107

Closed jackwakefield closed 2 years ago

jackwakefield commented 2 years ago

This is a bug fix for https://github.com/maxbanton/cwh/issues/96, which occurs when calling PutLogEvents with records spanning more than 24 hours.

The AWS SDK throws a CloudWatchLogsException with the message:

The batch of log events in a single PutLogEvents request cannot span more than 24 hours.

The CloudWatch handler will check whether a record's timestamp is more than 24 hours after the earliest timestamp, and if so calls PutLogEvents before adding the new record to the buffer.

No

N/A

coveralls commented 2 years ago

Coverage Status

Coverage increased (+1.6%) to 91.346% when pulling f2f8fed90a057834e005a08a8f1b40900693b5f1 on AlsoAsked:24-hour-timespan into 6433db00611a4522f5bf4c2f3228fdaf9bd2a7a6 on maxbanton:master.