maxbanton/cwh
AWS CloudWatch Handler for Monolog library
v3.0.0
16M downloads/mo
#1464 most downloaded on Packagist
maxbanton/cwh
What this package is like to depend on
Last release 3 months ago
03 May 2026
Ships unpredictably
gaps range from 9 days to 3.5 years
Rarely documented
notes for 2 of 26 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
26 releases · first in 2016
2 releases in the last 12 months
see the full history below
Release timeline
26 releases · Jul 2016 to May 2026Releases
latest 26-
v3.0.003 May 2026Release notes
Open source →Added
$createStreamconstructor argument (10th, defaulttrue). Set tofalseto skipDescribeLogStreams+CreateLogStreamwhen the log stream is provisioned out of band (e.g. via Terraform). Lets users drop the matching IAM permissions.- Full type coverage on the constructor and properties (constructor promotion,
readonlyfor immutable state). phpstan(level 8) runs in CI alongside lint and tests.
Changed
- Coding standard upgraded from PSR-2 to PSR-12.
- PHPUnit upgraded to
^10.5 || ^11.0.
Removed
- Support for PHP 7.x and 8.0. Minimum PHP is now
^8.1. - Support for Monolog 2. Minimum Monolog is now
^3.0.
Migration
- Replace any
Monolog\Logger::DEBUG(or other level constant) usage withMonolog\Level::Debug. The$levelconstructor argument continues to acceptint|string|Levelso string values like'debug'keep working. - Symfony service definitions referencing
!php/const Monolog\Logger::WARNINGmust change to!php/const Monolog\Level::Warning. - Subclasses overriding
protected function write(array $record): voidmust update the signature toprotected function write(\Monolog\LogRecord $record): voidand access fields via->propertyinstead of['key']. - The constructor parameter order, names, and defaults of the existing 9 arguments are unchanged. Existing Symfony positional
arguments:lists and Laravelwith/handler_withnamed-key configs continue to work after the platform upgrades above.
-
v2.1.001 May 2026Release notes
Open source →Added
- Public
flush()method for long-lived workers (Laravel queues, Symfony messenger, PHP-FPM with persistent state). The handler'sreset()is also overridden to flush, integrating with SymfonyResettableInterfaceand Laravel Octane'sFlushMonologState. (#95, thanks @DrLuke for #102) - README section documenting ECS / EC2 IAM Task Role credentials with
CredentialProvider::memoize(). (#103) - Docker-based local dev environment (
make build,make test,make matrix) running against PHP 8.2 / 8.3 / 8.4 / 8.5. - CI runs entirely in Docker containers; only
actions/checkoutandactions/upload-artifact(both official) are used. .gitattributesexcludes dev files from the Composer dist tarball;composer require maxbanton/cwhnow ships onlyLICENSE,README.md,composer.json, andsrc/Handler/CloudWatch.php(~57% smaller).
Changed
EVENT_SIZE_LIMITraised from 256 KB to 1 MB (1,048,550 bytes) to match the current AWS PutLogEvents quota. Messages between 256 KB and 1 MB are now shipped as a single CloudWatch event instead of split. (#101)
Removed
RPS_LIMITself-throttle (5 RPS). The library no longer sleeps to artificially cap PutLogEvents calls — the AWS quota is 5,000 TPS per account/region (1000× higher), and the AWS SDK's retry middleware handles real throttling automatically. (#111, #114)sequenceTokentracking. AWS deprecated this parameter in August 2023 —PutLogEventsignores it server-side and never throwsInvalidSequenceTokenExceptionorDataAlreadyAcceptedExceptionanymore. (thanks @a10waveracer for #115)- The retry-on-
CloudWatchLogsExceptionloop influshBuffer()(it existed solely to refresh the sequence token, which no longer matters).
Fixed
checkThrottle()had a latent bug —$current->diff($savedTime)->sreads only the seconds component of a DateInterval, misbehaving across minute boundaries. Fixed by removing the method entirely (see "Removed" above).
Compatibility
- No breaking public API changes. Adds public
flush()and overridesreset()to flush. Existing constructor and method signatures are unchanged; existing^2.0pins continue to work without modification. - Minimum PHP / Monolog versions unchanged (
^7.2 || ^8/monolog/monolog: ^2.0). CI tests PHP 8.2 – 8.5; no code paths require newer PHP.
- Public
-
v2.0.409 Nov 2022Nothing published for this version
-
v2.0.307 Nov 2022Nothing published for this version
-
v2.0.217 Nov 2020Nothing published for this version
-
v2.0.117 Jan 2020Nothing published for this version
-
v2.0.006 Jan 2020Nothing published for this version
-
v1.1.1406 Jan 2020Nothing published for this version
-
v1.1.1306 Oct 2019Nothing published for this version
-
v1.1.1211 Sep 2019Nothing published for this version
-
v1.1.1121 May 2019Nothing published for this version
-
v1.1.1005 Oct 2018Nothing published for this version
-
v1.1.909 May 2018Nothing published for this version
-
v1.1.827 Apr 2018Nothing published for this version
-
v1.1.717 Apr 2018Nothing published for this version
-
v1.1.629 Mar 2018Nothing published for this version
-
v1.1.426 Mar 2018Nothing published for this version
-
v1.1.302 Oct 2017Nothing published for this version
-
v1.1.202 Sep 2017Nothing published for this version
-
v1.1.131 Aug 2017Nothing published for this version
-
v0.1.129 Aug 2016Nothing published for this version
-
v1.131 Aug 2017Nothing published for this version
-
v1.004 Mar 2017Nothing published for this version
-
v0.322 Nov 2016Nothing published for this version
-
v0.209 Nov 2016Nothing published for this version
-
v0.103 Jul 2016Nothing published for this version