hexanet/monolog-extra-bundle
Symfony bundle that extends Monolog with extra logging tools, making it easier to enrich log records with additional context and configure richer logging pipelines in your application. It integrates with Symfony's service configuration for straightforward setup and minimal boilerplate.
Architecture fit — unchanged: poor as a dependency, good as a pattern source. Nothing in v3.0.2 alters the fundamental shape of the package. The distributable value remains a small set of Monolog processor classes and a request/response logging strategy; the surrounding Symfony DI glue (Bundle subclass, service configuration, compiler passes, autoconfiguration tags) still has no execution path in a Laravel application, which wires Monolog through config/logging.php and channel tap arrays. Two points from the prior assessment now require correction and one is reinforced:
symfony/framework-bundle constraint claim must be re-verified against the 3.x composer.json. It may be relaxed; it may not. Do not carry the old blocker forward untested — but do not assume it is lifted either.__invoke(array $record): array signature). That is a genuine, if modest, cost reduction for the port.Integration feasibility — still low for direct install, slightly better for extraction. The Composer resolution argument needs a fresh composer why-not test rather than a citation, but the architectural conclusion stands independently: a Symfony bundle cannot be composer required into a Laravel app to obtain behaviour, only to obtain dead weight and transitive constraints. What ports remains the processor classes, now presumably already on Monolog 3 types, dropping the port estimate from "small refactor pass" to "signature verification and a static analysis pass."
Technical risk — high, with the risk profile rotated rather than reduced.
Key questions for the team.
composer.json relaxed Symfony constraints, or does the 2018 blocker still hold? Re-test before reusing the old argument.Log::withContext(), middleware, RequestHandled, and Telescope.Stack fit — unchanged. Laravel's logging layer is Monolog underneath, so the concept fits cleanly even though the package does not. The idiomatic Laravel expression remains: middleware capturing request metadata and duration, Log::withContext([...]) for per-request correlation fields, and a channel-scoped tap class pushing one or two custom processors. No Symfony components required.
Migration path — extract, don't install (unchanged), with one new step.
app/Logging/Processors/, add declare(strict_types=1), verify Monolog 3 signatures, retain MIT attribution in a NOTICE file.http) so verbose request logging never contaminates application logs.Compatibility. Validate against the monolog/monolog version resolved in composer.lock. The 3.x line likely reduces the PHP 8.2+ deprecation exposure cited earlier (dynamic properties, ${var} interpolation), but this must be checked, not assumed. Run PHPStan level 6+ over the vendored copy before it enters a shared branch. Add an assertion test that pins the exact record shape we emit, so an upstream additions-key change cannot propagate silently through a future re-vendor.
Sequencing. (1) Re-verify package facts — constraint graph, release history, changelog presence — because the prior assessment's data is now partly wrong. (2) Requirements spike: confirm the observability gap is real and not already covered. (3) Extraction + modernization behind a feature flag. (4) Redaction, size-capping, and record-shape assertion tests. (5) Canary on one low-traffic service for two weeks, measuring log volume delta and p99 latency. (6) Roll out or roll back. Still a background improvement, not a milestone; it should not block any other workstream.
Maintenance. Movement from "permanent fork of an archived repo" to "permanent fork of a barely-documented low-activity repo" is a marginal improvement. There is now an upstream that might absorb Monolog majors and PHP minors, but the v3.0.2 note is evidence that consuming upstream changes blind is dangerous. Recommended posture: vendor the code, track upstream for security and compatibility signals only, and cherry-pick deliberately rather than following releases. Budget a recurring fraction of an engineer's time either way.
Support. No vendor, no SLA. There may now be an issue tracker, but the release-note quality suggests it is not a reliable support channel. Internal on-call still owns incidents. The LOG_HTTP_ENABLED=false kill switch remains mandatory, not optional, and — given the additions change — should be paired with the ability to revert log-schema changes independently of code deploys.
Scaling. Unchanged and still the dominant cost driver at volume. Request/response body logging scales non-linearly: file uploads, base64 blobs, PDFs, and large GraphQL responses inflate log lines into the megabytes, multiply shipping and storage across replicas, and can saturate aggregator ingest quotas during an incident — exactly when volume spikes. Enforce a hard byte cap per field, truncate with an explicit marker, skip non-text content types, and sample (headers/status always; bodies at 1–5%). The additions-key change adds a second scaling concern: schema churn forces index remapping and dashboard rework, which is cheap per-change and expensive in aggregate.
Failure modes to design against.
days and alert at 80% volume.Ramp-up. Technical ramp-up drops slightly — 3.x-era code means less modernization work — but the organizational ramp-up is unchanged and still the real cost: establishing a log-redaction standard, agreeing on retention, and getting sign-off that owning a fork of a thinly documented upstream is acceptable. The recommendation also stands, with a sharper rationale: build a narrow in-house equivalent using this as a design reference. The value is unchanged; the dependency risk is no longer "abandoned" but "unpredictable," and for a component on the request hot path and in the log-schema contract, unpredictable is not meaningfully better than abandoned. The v3.0.2 release note is the clearest available evidence of what upstream maintenance will look like.
How can I help you explore Laravel packages today?