Airbrake.io & Errbit integration for Symfony 3/4/5. This bundle plugs the Airbrake API client into Symfony project

Related tags

API airbrake-bundle
Overview

AmiAirbrakeBundle

Build Status Coding Style Latest Stable Version Total Downloads Latest Unstable Version SensioLabsInsight License

Airbrake.io & Errbit integration for Symfony 3/4/5. This bundle plugs the Airbrake API client into Symfony project.

Prerequisites

This version of the bundle requires Symfony 3.4+ and php 7.2+

Installation

Step 1: Download AmiAirbrakeBundle using composer

Add AmiAirbrakeBundle in your composer.json:

$ composer require aminin/airbrake-bundle

Step 2: Enable the bundle

Enable the bundle in the kernel:


// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Ami\AirbrakeBundle\AmiAirbrakeBundle(),
    );
}

Step 3: Configure the AmiAirbrakeBundle

Add the following configuration to your config.yml file

# app/config/config.yml
ami_airbrake:
    project_id:  YOUR-PROJECT-ID
    project_key: YOUR-API-KEY

Configuration reference

ami_airbrake:
    # This parameter is required
    # For Errbit the exact value of project_id doesn't matter
    project_id: YOUR-PROJECT-ID

    # Omit this key if you need to enable/disable the bundle temporarily 
    # If not given, this bundle will ignore all exceptions and won't send any data to remote.
    project_key: YOUR-API-KEY

    # By default, it is set to api.airbrake.io.
    # A host is a web address containing a scheme ("http" or "https"), a host and a port.
    # You can omit the scheme ("https" will be assumed) and the port (80 or 443 will be assumed).
    host: http://errbit.localhost:8000

    # You might want to ignore some exceptions such as http not found, access denied etc.
    # By default this bundle ignores all HttpException instances. (includes HttpNotFoundException, AccessDeniedException)
    # To log all exceptions leave this array empty.
    ignored_exceptions: ["Symfony\Component\HttpKernel\Exception\HttpException"]

parameters:
  # You may modify these parameters at your own risk
  ami_airbrake.notifier.class: 'Airbrake\Notifier'
  ami_airbrake.exception_listener.class: 'Ami\AirbrakeBundle\EventListener\ExceptionListener'
  ami_airbrake.shutdown_listener.class: 'Ami\AirbrakeBundle\EventListener\ShutdownListener'

Usage

Once configured, bundle will automatically send exceptions/errors to airbrake server.

You may access the Notifier as ami_airbrake.notifier service

    /** @var ContainerInterface $container */
    $container->get('ami_airbrake.notifier')->addFilter(function ($notice) {
        $notice['context']['environment'] = 'production';
        return $notice;
    });

License

This bundle is under the MIT license. See the complete license in the Resources/meta/LICENSE

References

Airbrake API client: https://github.com/airbrake/phpbrake

Comments
  • Add possibility to add a filter

    Add possibility to add a filter

    I'd like to call the addFilter function of the Notifier API, but I don't see a way to get the notifier. Is it possible to add a functionality for this?

    opened by delx 3
  • Error for symfony 5.1.2

    Error for symfony 5.1.2

    Description: Installing this bundle in Symfony 5 errors out with You have requested a non-existent parameter "kernel.root_dir". Did you mean one of these: "kernel.project_dir", "kernel.cache_dir", "kernel.logs_dir"?

    How to reproduce: Install symfony the latest and then install this bundle

    Possible Solution: https://github.com/aminin/airbrake-bundle/pull/8

    opened by cybervoid 1
  • - changed root variables

    - changed root variables

    • This PR fixes "You have requested a non-existent parameter "kernel.root_dir". Did you mean one of these: "kernel.project_dir", "kernel.cache_dir", "kernel.logs_dir"?" Error on Symfony5.0.8
    opened by cybervoid 1
  • Update

    Update

    I closed the previous Pull Request inadvertently.

    The PR motive is due to airbrake warnings with the version 0.1., where they explicitly request that it be updated to 0.2. in airbrake/phpbrake package.

    Is the only change.

    Thanks!

    opened by davidjdr 1
  • Cant deactivate bundle if using explicit DependancyInjection

    Cant deactivate bundle if using explicit DependancyInjection

    I am running in to a problem when trying to follow latest Symfony standards and disable the Notifier for dev/test environments.

    I have a listener that grabs the service and adds context if the service is present. Up until recently I was inserting the container to this listener, checking if the Notifier was present and using it but as of Symfony 5.1 I'm getting this error

    The "ami_airbrake.notifier" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

    If I switch to direct injection everything is happy until I disable the service by setting the airbrake key to null (as per the docs) the service is not loaded and the compile fails.

    I have worked around this problem this with my own services but substituting a Mock Service object instead of the real Notifier when in dev, I'd be happy to submit a PR that adds a NotifierInterface class that can be implemented by both real and Mock Services to make this possible if that'd be accepted or is there a more tidy solution?

    opened by benrcole 0
Owner
Anton Minin
Anton Minin
Symfony Health Check Bundle Monitoring Project Status

Symfony Health Check Bundle Version Build Status Code Coverage master develop Installation Step 1: Download the Bundle Open a command console, enter y

MacPaw Inc. 27 Jul 7, 2022
Raidbots API wrapper which incorporates existing reports and static data into your project.

Raidbots API Raidbots API wrapper which incorporates existing reports and static data into your project. Usage use Logiek\Raidbots\Client; $client =

Logiek 2 Dec 23, 2021
This bundle provides tools to build a complete GraphQL server in your Symfony App.

OverblogGraphQLBundle This Symfony bundle provides integration of GraphQL using webonyx/graphql-php and GraphQL Relay. It also supports: batching with

Webedia - Overblog 720 Dec 25, 2022
Pure PHP implementation of GraphQL Server – Symfony Bundle

Symfony GraphQl Bundle This is a bundle based on the pure PHP GraphQL Server implementation This bundle provides you with: Full compatibility with the

null 283 Dec 15, 2022
DataTables bundle for Symfony

Symfony DataTables Bundle This bundle provides convenient integration of the popular DataTables jQuery library for realtime Ajax tables in your Symfon

Omines Internetbureau 199 Jan 3, 2023
GraphQL Bundle for Symfony 2.

Symfony 2 GraphQl Bundle Use Facebook GraphQL with Symfony 2. This library port laravel-graphql. It is based on the PHP implementation here. Installat

Sergey Varibrus 35 Nov 17, 2022
An Unleash bundle for Symfony applications to provide an easy way to use feature flags

Unleash Bundle An Unleash bundle for Symfony applications. This provide an easy way to implement feature flags using Gitlab Feature Flags Feature. Ins

Stogon 7 Oct 20, 2022
A bundle providing routes and glue code between Symfony and a WOPI connector.

WOPI Bundle A Symfony bundle to facilitate the implementation of the WOPI endpoints and protocol. Description The Web Application Open Platform Interf

Champs-Libres 5 Aug 20, 2022
Mediator - CQRS Symfony bundle. Auto Command/Query routing to corresponding handlers.

Installation $ composer require whsv26/mediator Bundle configuration // config/packages/mediator.php return static function (MediatorConfig $config)

Alexander Sv. 6 Aug 31, 2022
Symfony bundle for EventSauce (WIP)

Symfony EventSauce (WIP) This bundle provides the basic and extended container configuration of symfony for the EventSauce library. Before using it, I

Andrew Pakula 8 Dec 19, 2022
Symfony bundle integrating server-sent native notifications

Symfony UX Notify Symfony UX Notify is a Symfony bundle integrating server-sent native notifications in Symfony applications using Mercure. It is part

Symfony 6 Dec 15, 2022
Bundle to integrate Tactician with Symfony projects

TacticianBundle Symfony2 Bundle for the Tactician library https://github.com/thephpleague/tactician/ Installation Step 1: Download the Bundle Open a c

The League of Extraordinary Packages 240 Jan 4, 2023
A Symfony bundle that provides #StandWithUkraine banner and has some built-in features to block access to your resource for Russian-speaking users.

StandWithUkraineBundle На русском? Смотри README.ru.md This bundle provides a built-in StandWithUkraine banner for your Symfony application and has so

Victor Bocharsky 10 Nov 12, 2022
Integration with your Symfony app & Vite

ViteBundle : Symfony integration with Vite This bundle helping you render all of the dynamic script and link tags needed. Essentially, he provide two

Hugues Tavernier 84 Dec 21, 2022
Simple PHP API client for tube-hosting.com rest API

Tube-Hosting API PHP client Explanation This PHP library is a simple api wrapper/client for the tube-hosting.com api. It is based on the provided docu

null 4 Sep 12, 2022
Chargebee API PHP Client (for API version 2 and Product Catalog version 2.0)

chargebee-php-sdk Overview This package provides an API client for Chargebee subscription management services. It connects to Chargebee REST APIs for

GLOBALIS media systems 8 Mar 8, 2022
Copy of hautelook/alice-bundle v2.9.0

AliceBundle A Symfony bundle to manage fixtures with nelmio/alice and fzaninotto/Faker. The database support is done in FidryAliceDataFixtures. Check

Global4Net Ltd. 3 Sep 10, 2021
The maker bundle allows you to generate content elements, front end modules

Contao 4 maker bundle The maker bundle allows you to generate content elements, front end modules, event listener, callbacks and hooks using interacti

Contao 7 Aug 3, 2022
The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Nelmio 2.1k Jan 6, 2023