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

Bugsnag Bundle Laravel Package

simpleweb/bugsnag-bundle

Symfony bundle that integrates Bugsnag error monitoring into your application, helping capture exceptions and report them with context so you can track and debug production issues more effectively.

View on GitHub
Deep Wiki
Context7

Getting Started

Read this first: simpleweb/bugsnag-bundle is a Symfony2 bundle, not a Laravel package. It has no ServiceProvider, no facade, no config/bugsnag.php, and will not be picked up by Laravel's package auto-discovery. Its entire job is to register Bugsnag_Client in the Symfony DI container and wire the kernel exception listener. If you are actually on Laravel, stop here and use bugsnag/bugsnag-laravel. If you are evaluating this to learn the shape of the integration, or maintaining a legacy Symfony 2.x app, the setup is:

  1. composer require simpleweb/bugsnag-bundle — expect to pin old constraints; this targets PHP 5.x / Symfony 2.3–2.8 era.
  2. Register the bundle in app/AppKernel.php:
    new SimpleWeb\BugsnagBundle\SimpleWebBugsnagBundle(),
    
  3. Add config in app/config/config.yml:
    simpleweb_bugsnag:
        api_key: "%bugsnag_api_key%"
        environment: "%kernel.environment%"
    
  4. Source the key from parameters.yml / env, never the committed config.
  5. Where to look first: the DependencyInjection/Configuration.php and DependencyInjection/SimpleWebBugsnagExtension.php classes. The README is thin; every tunable lives in those two files.
  6. First use case: prove uncaught exception capture. Throw a deliberate exception from a controller, confirm it appears in the Bugsnag dashboard with the right environment and release stage. Don't wire anything else until that works.

For a Laravel developer, the whole bundle is a ~50-line mental model: one container-bound Bugsnag client, one kernel exception listener, config-driven toggling per environment. You get all three out of the box from bugsnag/bugsnag-laravel via config/bugsnag.php and Handler::report().

Implementation Patterns

Automatic exception capture (the 90% case). The bundle hooks Symfony's exception listener; you write zero code and uncaught exceptions are reported. In Laravel terms this is App\Exceptions\Handler::report(). Get it working, verify it, and don't touch it again.

Manual notification from the container. The Bugsnag_Client is exposed as the bugsnag service, so anywhere the container is available (controllers-as-services, console commands) you can call:

$this->get('bugsnag')->notifyException($e);

The Laravel analogue is Bugsnag::notifyException($e) via the facade — prefer that in Laravel so it is mockable in tests.

Reporting caught-and-handled exceptions. The pattern worth copying: when you deliberately swallow an exception (retry loops, third-party timeouts), still notify at warning severity rather than losing the event.

// Symfony bundle
$this->get('bugsnag')->notifyException($e, null, 'warning');
// Laravel equivalent
Bugsnag::notifyException($e, function ($report) {
    $report->setSeverity('warning');
});

User and request context. Attach the authenticated user so Bugsnag can dedupe and show affected-user counts. With the bundle this happens from a kernel/request listener or a base controller; in Laravel the idiomatic spot is middleware:

Bugsnag::registerCallback(function ($report) {
    $report->setUser(['id' => auth()->id(), 'email' => auth()->user()?->email]);
});

Metadata for debugging. Add breadcrumb-ish context before risky operations via setMetaData('order', ['id' => $id]) on the service. In Laravel you can also call Bugsnag::leaveBreadcrumb() inside jobs to trace a retry trail.

Queue / worker integration. Both ecosystems need the same care: exceptions inside queued jobs are not caught by the HTTP kernel listener. You must notify explicitly in the job's failure path (failed() in Laravel; the corresponding worker event listener in Symfony). This is the single most common "why aren't my job errors in Bugsnag?" answer.

Release-stage gating. Configure notify_release_stages so local/dev noise doesn't pollute the dashboard. In Laravel this is 'notify_release_stages' => ['production', 'staging'] in config/bugsnag.php.

Gotchas and Tips

  • Wrong framework — read this twice. No ServiceProvider, so Laravel auto-discovery finds nothing, and there's no facade or publishable config. composer require-ing this into a Laravel app will fail silently at best and blow up at worst.
  • Effectively unmaintained. One star, zero dependents, near-zero maturity score. The API surface is frozen around Symfony 2 and old bugsnag-php versions. Expect Composer conflicts on modern PHP and modern Symfony. Treat it as a reference implementation, not a dependency; if you must adopt it, plan for a fork you own.
  • API key handling. Never commit it into config.yml. Pass it as a %parameter% sourced from parameters.yml / env. In Laravel this is BUGSNAG_API_KEY in .env and config/bugsnag.php.
  • Synchronous delivery by default. notifyException performs an HTTP call. On a slow network this blocks the request — or worse, the queue worker. Set a short timeout, and in high-volume paths consider Bugsnag::setBatchSending(true) / queued delivery in Laravel.
  • Debugging "nothing arrives in Bugsnag". Check, in order: (1) is the bundle registered before other exception listeners, (2) is notify_release_stages excluding the current environment, (3) is the API key actually resolving (dump the service), (4) are exception-handling filters swallowing the error before the listener sees it, (5) is the container even building the service (a broken bugsnag-php version will fail silently in a try/catch).
  • PII risk. Out of the box, request data and user identifiers may be captured. Configure filters / meta_data_filters for passwords, tokens, and internal identifiers, and prefer explicit user context over blanket request capture in regulated environments.
  • Extension point worth knowing. The bugsnag service is a plain Bugsnag_Client — you can call registerCallback() on it in a compiler pass to add global metadata, custom grouping, or release-stage logic without forking the bundle.
  • Migration tip. If you're on a legacy Symfony 2.x app just to keep reporting alive, isolate the bundle behind a PoC branch, pin constraints, verify end-to-end delivery, and document removal during the framework upgrade. The correct long-term target is the first-party bugsnag/bugsnag-symfony (or Laravel) SDK.
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