mrandmrssmith/monolog-bugsnag-bundle
Symfony bundle for integrating Monolog with Bugsnag. It wires a Bugsnag handler into Symfony's logging stack so application log records can be forwarded to Bugsnag for error tracking, alerting, and centralized visibility.
Architecture fit — poor at the package level, plausible at the class level. The artifact is a Symfony bundle (*Bundle, DependencyInjection/, service definitions) wrapping a Monolog 3 handler for Bugsnag. Laravel has no bundle auto-registration mechanism; bundle packages are inert in an Illuminate application. Composer will install it, but the only piece of the package a Laravel app can actually use is the handler class itself. Everything else — extension class, DI config, Symfony service wiring — is dead weight, yet still pulls symfony/framework-bundle (and its DI/HttpKernel config surface) into our dependency graph. For a Laravel 10/11 codebase whose logging stack is config/logging.php → LogManager → Monolog 3, that is an architectural mismatch, not a fit.
Integration feasibility — technically trivial, organizationally awkward. The usable work is roughly a 40–80 line Monolog handler: extend Monolog\Handler\AbstractProcessingHandler, take a Bugsnag\Client in the constructor, call notifyException() in write(), optionally honor bubble and a minimum level. Wiring it into Laravel is a custom channel in config/logging.php and a LOG_STACK entry. That is a half-day of engineering plus tests. The hard part is not building it; it is justifying a third-party 1-star dependency to do it.
Technical risk — low runtime blast radius, high governance blast radius.
| Dimension | Assessment |
|---|---|
| Correctness risk | Low. A log handler is a leaf component; worst case is dropped or duplicated Bugsnag events, not app failure — provided the handler swallows transport exceptions (must verify; a throwing handler inside the error path is a classic recursive-failure incident). |
| Supply-chain risk | Medium. 1 star, 0 dependents, single maintainer, last release Feb 2024. No meaningful community review of the code. It is small enough to audit in an afternoon, but there is no one else auditing it on our behalf. |
| Legal/approval risk | Blocking. License is NOASSERTION — Composer cannot resolve a recognized SPDX identifier. In most enterprises this fails automated license scanning and cannot ship without a manual legal exception for an effectively unknown license. That exception is very hard to justify for a fork of a component we could write ourselves. |
| Vendor backing | None. This is an individual maintainer, not Bugsnag/SmartBear. It appears to exist to bridge a Monolog 3 compatibility gap in the vendor handler. |
| Maintenance signal | Single commit-era release; no CI badge evidence reviewed; no dependents to surface regressions. Assume no upstream support SLA. |
Key questions to resolve before any go decision:
bugsnag/bugsnag-laravel (current major) already ship a Monolog 3-compatible handler? If yes, this package has no reason to exist for us and the evaluation ends. If no, the gap is real — but is it a gap worth a dependency, or a 50-line shim?bugsnag/bugsnag-psr-logger? If it is a composer.json constraint bump plus a namespace change, the "product" here is near-zero.NOASSERTION, or is the answer a hard no? This is a go/no-go gate, not a risk to be tracked.discardClasses config we already use?TPM read: Score 0.005 with 1 star and 0 dependents is an accurate signal — this is not a component to adopt, it is a reference implementation. Its value to us is as a known-good example of the Monolog 3 handler contract, and as evidence that a compatibility gap exists. Treat it as a spike input, not a dependency.
Stack fit. Laravel 10+ (Monolog 3) is the only reason this package is interesting. On Laravel 9 (Monolog 2) it is irrelevant. Our target stack — Laravel 11, PHP 8.2/8.3, Bugsnag via bugsnag/bugsnag-laravel, Monolog 3 through the framework — means the handler interface we need is Monolog\Handler\AbstractProcessingHandler with Bugsnag\Client as the collaborator.
Recommended path (in preference order):
bugsnag/bugsnag-laravel supports Monolog 3. Wire Bugsnag as a stack/channels target in config/logging.php, keep exception reporting on bootstrap/app.php → withExceptions() so uncaught exceptions and report() go through one path. Zero new code, vendor-backed, license-clean. This should be the default answer.App\Logging\BugsnagHandler extends AbstractProcessingHandler, wrap Bugsnag\Client, catch and Log-swallow transport exceptions, register it as a custom channel via Log::extend/a channel factory, and unit-test that (a) handle() never throws, (b) level filtering works, (c) bubble=false stops propagation. Cost: 1–2 engineer-days including tests. This is the recommended path if option 1 fails.symfony/framework-bundle for a class we could write in an afternoon, inherits an unresolvable license, and creates a dependency with no maintainer to page.Migration path if we already have log-to-Bugsnag behavior: none needed if we standardize on the official channel. If we are currently on a custom handler (or Monolog 2 pinning), the migration is: bump to Monolog 3, verify the channel still receives records, verify report() path still delivers, verify breadcrumbs and release-stage tags survive. Keep the old channel config behind a feature flag for one release cycle.
Compatibility and sequencing.
| Step | Owner | Output | Gate |
|---|---|---|---|
| 1. Verify official SDK Monolog 3 support | Backend lead | One-paragraph finding + composer constraint check | If yes → stop, use official SDK |
2. Legal review of NOASSERTION |
Legal/TPM | Written yes/no | Hard gate; no = discard package |
| 3. If needed, write internal handler | Backend | PR + tests + channel config | Code review by platform owner |
| 4. Shadow-run one sprint | SRE/TPM | Event volume parity vs. current pipeline | No PII leakage, no volume spike |
| 5. Remove workaround when upstream lands | Platform | Deletion PR | Tracked in backlog with a 2-quarter horizon |
Sequence the work after the Monolog 3 upgrade lands, not alongside it — do not couple two failure domains (framework logging upgrade + new error transport) in one release.
Maintenance. As a dependency, this package has no maintenance model: one maintainer, no visible release cadence, no dependents to surface breakage, and a Feb-2024 last release that will silently rot as Monolog and Bugsnag majors move. As an internal 50-line shim, maintenance is near-zero — it implements a stable interface (AbstractProcessingHandler) against a stable API (Client::notifyException). The shim is objectively cheaper to own than the dependency is to babysit, which is the central TPM argument against adoption.
Support. No vendor, no SLA, no security contact. If a CVE lands in the handler logic (e.g. payload construction, header capture), we are the only responders. That is acceptable for code we wrote and reviewed; it is not acceptable for code we pulled from an unaffiliated 1-star repository whose license we cannot name.
Scaling. Handler-level cost is negligible relative to the Bugsnag HTTP flush, but three scaling behaviors need explicit design:
Log::error traffic to Bugsnag multiplies event counts and Bugsnag plan costs. Enforce a level floor (error and above) and use Bugsnag::setBatchSending/notification throttling. This is a budget decision, not an engineering one — TPM must set the policy.terminate hook. Same concern applies equally to the official SDK.withExceptions path and reserving the log channel for caught-and-logged error/critical records.Failure modes to design against.
write(), never bubble exceptions; log the transport failure to the fallback (stderr/local file) channel.dontReport allowlist; audit payloads in the shadow sprint.release_stage, job class, and queue name as metadata via a middleware/JobProcessing listener.Ramp-up. Engineering ramp is trivial — half a day for anyone who has wired a custom Monolog channel; the interface is well known and the shim is small. The real ramp cost is organizational: legal exception process for an ambiguous license (days-to-weeks, often an outright no), security review of an unaudited dependency, and the ongoing cognitive tax of a pinned, unmaintained package in the graph. Total cost of ownership strongly favors either the official SDK channel or a self-owned handler over adopting this package.
Recommendation: Do not take a production dependency on mrandmrssmith/monolog-bugsnag-bundle. Close the underlying need — Monolog 3 → Bugsnag delivery on Laravel 10+ — via the official Bugsnag Laravel SDK if it supports Monolog 3, else via a ~50-line internally owned handler. Use this repository only as a reference implementation during the spike, and record it in the decision log as evaluated and rejected: license unresolved, zero adoption, Symfony-shaped for a Laravel stack.
How can I help you explore Laravel packages today?