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.
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:
composer require simpleweb/bugsnag-bundle — expect to pin old constraints; this targets PHP 5.x / Symfony 2.3–2.8 era.app/AppKernel.php:
new SimpleWeb\BugsnagBundle\SimpleWebBugsnagBundle(),
app/config/config.yml:
simpleweb_bugsnag:
api_key: "%bugsnag_api_key%"
environment: "%kernel.environment%"
parameters.yml / env, never the committed config.DependencyInjection/Configuration.php and DependencyInjection/SimpleWebBugsnagExtension.php classes. The README is thin; every tunable lives in those two files.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().
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.
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.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.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.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.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).filters / meta_data_filters for passwords, tokens, and internal identifiers, and prefer explicit user context over blanket request capture in regulated environments.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.bugsnag/bugsnag-symfony (or Laravel) SDK.How can I help you explore Laravel packages today?