phpnexus/cwh
A Monolog handler for Amazon CloudWatch Logs. phpnexus/cwh lets PHP applications send PSR-3 log records to CloudWatch through the AWS SDK, with configurable log groups and streams, batching, and flexible level handling for production logging.
phpnexus/cwh replaces a bespoke Monolog handler (typically 200–400 LOC of batching, retry, credential refresh, sequence-token ordering, and 256 KB event truncation logic) with a maintained MIT dependency. This is a "buy" decision with essentially zero licence cost and low switching cost — the handler is instantiated in config/logging.php, so backing it out is a config change plus a deploy.monolog channel, so we get cross-service log search and Logs Insights querying without procuring Datadog/Papertrail or standing up an ELK cluster. This directly supports roadmap items around incident response and on-call runbooks..env or CI secrets — a compliance and audit talking point.phpnexus/cwh is the maintained lineage of maxbanton/cwh, which stalled on Monolog 3 / modern PHP. This is a low-drama dependency upgrade that unblocks framework upgrades (Laravel 10/11 ship Monolog 3), and is best framed as "keeping the lights on" hygiene rather than a new capability.Adopt when:
maxbanton/cwh is not an option.Look elsewhere when:
aws-for-fluent-bit is the better architecture: no app-side coupling, no credential handling, no blocking on log I/O, and it survives app crashes. This package becomes redundant.To executives: We can get centralized, searchable application logs on AWS for effectively zero licence spend by adding a small MIT-licensed library to our existing Laravel logging config. It uses our existing AWS permissions rather than new API keys, needs no new vendor contract, and is removable in one deploy if we change direction. The trade-off is that it's a community-maintained package (not AWS-supported), so we should treat it as a tactical solution and revisit if log volume or compliance requirements grow.
To engineering: phpnexus/cwh gives us a Monolog handler that ships to CloudWatch Logs through the AWS SDK credential chain, so we just add a cloudwatch channel in config/logging.php and point LOG_STACK at it alongside our existing channels. It's the maintained successor to the unmaintained maxbanton/cwh and is Monolog 3 compatible. Two engineering guardrails: pin the version and note the fork lineage in our dependency register, and don't put it on a latency-critical path unless we batch or queue the writes. If we containerize later, we should plan to retire it in favour of stdout + FireLens — cheaper, more resilient, and less code to own.
How can I help you explore Laravel packages today?