Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Monolog Bugsnag Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. Does 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?
  2. What is the actual diff between this handler and Bugsnag's official handler / bugsnag/bugsnag-psr-logger? If it is a composer.json constraint bump plus a namespace change, the "product" here is near-zero.
  3. Can legal resolve NOASSERTION, or is the answer a hard no? This is a go/no-go gate, not a risk to be tracked.
  4. Who owns the code if we adopt — and what is the exit trigger (e.g. upstream Monolog 3 support landing, at which point we delete this)?
  5. What data classification flows into Bugsnag payloads (exception messages, stack context, breadcrumbs, request bodies), and does the handler respect Bugsnag's PII scrubbing and 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.

Integration Approach

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):

  1. Use the official SDK's channel. Confirm 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.
  2. Internal shim, ~50 LOC, own the copyright. If the vendor handler genuinely lacks Monolog 3 support: write 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.
  3. Fork this repo into our GitHub org and pin it. Only if legal approves the license and we want to preserve the Symfony bundle wrapper for a future Symfony service. For a Laravel-only roadmap this is unjustifiable overhead.
  4. Install this package as-is into Laravel. Not recommended: pulls 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.

Operational Impact

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:

  • Event volume / cost. Routing all 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.
  • Synchronous HTTP in the request path. Bugsnag delivery on the hot path adds tail latency. Confirm the client queues and flushes at terminate; if not, wrap delivery in a queued job or terminate hook. Same concern applies equally to the official SDK.
  • Noise. Unhandled-exception reporting and log-error reporting will double-count the same event. Deduplicate by keeping exception reporting on Laravel's withExceptions path and reserving the log channel for caught-and-logged error/critical records.

Failure modes to design against.

  1. Recursive failure — handler throws while handling an error. Mitigation: catch-all inside write(), never bubble exceptions; log the transport failure to the fallback (stderr/local file) channel.
  2. Silent data loss — Bugsnag unreachable or API key misconfigured at deploy; errors vanish with no alarm. Mitigation: synthetic check that emits a tagged test event per environment on deploy, plus a heartbeat/alert on the Bugsnag project's event count.
  3. PII leakage — exception context, request bodies, or breadcrumbs carrying customer data to a third party. Mitigation: apply Bugsnag's filter callbacks and a dontReport allowlist; audit payloads in the shadow sprint.
  4. Dependency drift — abandoned package pinned to a stale Monolog constraint blocks a future framework upgrade. Mitigation: pin with a documented expiry date and an owner; this is exactly the debt the shim avoids.
  5. Queue/worker blindness — CLI and queue contexts lack the request metadata, producing unactionable events. Mitigation: set 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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource