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

Airbrake Bundle Laravel Package

eo/airbrake-bundle

EoAirbrakeBundle integrates Airbrake.io and Errbit error tracking into Symfony2 apps, forwarding exceptions with configurable async delivery, optional API key toggling, and a built-in simulate route for testing.

View on GitHub
Deep Wiki
Context7

Getting Started

First, decide whether you're actually the target audience. This is a Symfony 2.1–2.x bundle — Eo\AirbrakeBundle\EoAirbrakeBundle registered in AppKernel, configured under eo_airbrake in config.yml, with a Twig extension. There is no service provider, no facade, no config/app.php entry. If you're in a Laravel app, stop here and read the last block of this section; if you've inherited a legacy Symfony app that needs exception reporting, this is a ~15-minute install.

Install (legacy Symfony only). Pin the tag, don't take dev-master as the README suggests:

{ "require": { "eo/airbrake-bundle": "^1.0" } }

Register in app/AppKernel.php, then the minimum viable config:

# app/config/config.yml
eo_airbrake:
    api_key: "%airbrake_api_key%"

That's it — the bundle hooks the kernel exception listener and starts forwarding automatically. No code changes.

Where to look first when it misbehaves, in this order:

  1. DependencyInjection/Configuration.php — the real config tree; the README's reference has typos and is incomplete.
  2. DependencyInjection/EoAirbrakeExtension.php — how api_key/host/async/secure map onto the Airbrake notifier service.
  3. The notifier service definition — this is where you'll attach release tags, environment, and user context, because the bundle gives you none of that.
  4. Twig/ — the airbrake_notifier() extension.

First use case: prove the pipe works before you tune it. Add the simulation route in app/config/routing_dev.yml (dev only, never prod):

eo_airbrake_simulate:
    pattern: /airbrake/simulate
    defaults: { _controller: EoAirbrakeBundle:Simulate:index }

Hit it, then confirm the notice landed in Airbrake/Errbit. If nothing arrives, the problem is upstream of your app code — check host, secure, and whether api_key is actually resolving (an omitted key silently disables the whole bundle).

If you're on Laravel (the scenario most readers are in): do not bridge this. The equivalent is one report() call in App\Exceptions\Handler plus the official airbrake/airbrake-php notifier, or Sentry/Flare. Everything below about what to configure still applies; only the wiring differs.

Implementation Patterns

Environment-scoped configuration. The single most useful property of this bundle is that omitting api_key turns it into a no-op. Lean on that instead of conditional service loading:

# config_dev.yml — reporting disabled entirely
eo_airbrake: ~
# config_prod.yml
eo_airbrake:
    api_key: "%airbrake_api_key%"
    host: errbit.internal.example.com
    async: true
    secure: true

Keep the key in parameters.yml/env, never in the committed config.

Async by default, sync when you're debugging. async: true uses a socket write and does not wait for a response — zero request latency, but also zero feedback: you cannot distinguish "sent" from "silently dropped." When you're validating an Errbit host or chasing a "why is nothing showing up" bug, flip to async: false for a cURL round-trip and read the error. Flip it back before you ship, or a slow/unreachable error backend becomes a latency incident.

Curate ignored_exceptions deliberately — this is the whole game. The default ignores Symfony\Component\HttpKernel\Exception\HttpException, which is the base class for the whole 4xx family and some 5xx paths. That's a blunt instrument. Since the base class is only a default, override with concrete subclasses:

eo_airbrake:
    ignored_exceptions:
        - Symfony\Component\HttpKernel\Exception\NotFoundHttpException
        - Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
        - Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
        # note: deliberately NOT HttpException — keep 5xx

Note the semantics: setting the array replaces the default rather than appending to it. If you set ignored_exceptions: [] you get literally everything, including 404s from bots — expect a bill spike.

Client-side errors via the Twig helper. One line in your base layout:

<head>
    {{ airbrake_notifier() }}
</head>

This emits the Airbrake JS notifier pointed at your configured host. It captures uncaught JS exceptions, nothing else — no console.error, no promise rejections, no source maps. Treat it as a bonus, not a front-end monitoring strategy.

Manual notification for caught exceptions. The bundle only sees what reaches the kernel. For exceptions you swallow and handle, pull the notifier service and report explicitly:

$notifier = $this->get('eo_airbrake.notifier'); // verify the service id in the extension
$notifier->notify($exception);

Use this sparingly — for queue workers, console commands, and payment/webhook handlers where a swallowed exception is a real incident.

Attach a release marker. There's no built-in deploy tagging, and this is the highest-value thing you'll add. Decorate the notifier service or set the framework/environment context at build time so every notice carries your app version — otherwise "did this ship with Tuesday's deploy?" is unanswerable.

Gotchas and Tips

The bundle is unmaintained — own it accordingly. Last release 2016-11-16, five stars, zero dependents. No CVE path, no issue triage. Vendor it and budget for patching: expect PHP 7.4/8.x breakage from removed functions and hardened type handling, and possible Guzzle drift underneath. Verify composer resolution before promising a timeline.

The Airbrake v2 surface is terminal. This targets /notifier_api/v2/notices, which hosted Airbrake.io has moved past. Errbit is the credible runtime target precisely because it's self-hosted and committed to v2 compatibility. If the destination is hosted Airbrake, plan to replace the notifier, not debug this one.

Silent failure is the default failure mode. With async: true and an unreachable host, nothing throws, nothing logs, and errors vanish. If you own this in production, add a smoke test that sends a synthetic exception on a schedule — otherwise you discover reporting was broken after the incident you needed it for.

Watch for recursive reporting. If your notifier or its transport throws (bad DNS, connection refused in sync mode), that exception can propagate back through the error handler. Guard the reporter itself and never let monitoring take down the request.

secure: true is the default and will bite you on internal Errbit. An on-prem Errbit served over plain HTTP on a private network will fail TLS negotiation. Set secure: false for that host, or front Errbit with TLS — do not disable verification some other way.

The simulate route is a live error generator. It throws deliberately. Keep it in routing_dev.yml only, or you've shipped a trivially discoverable endpoint that inflates your error quota and pollutes your issue list.

You get no context for free. No user id, no breadcrumbs, no request body scrubbing, no tracing — this is exception-only. Payloads can carry request parameters, so if you're in a regulated environment, verify what actually leaves the network and redact at the notifier boundary.

For Laravel: the capability is ~20 lines, so build the glue. Register a supported notifier and configure four things in App\Exceptions\Handler / config: API key, environment, ignored-exception list, release marker. That's the entire feature. The one genuinely transferable idea from this package is the api_key-omitted-means-disabled pattern — reproduce it, since it makes "turn off error reporting in local dev" a config concern rather than a code branch.

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.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log