Giter Site home page Giter Site logo

raygunbundle's Introduction

RaygunBundle

Raygun4PHP is a Raygun.io provider for PHP 5.3+. Raygun4js is a is a Raygun.io plugin for JavaScript. This bundle registers the library with the framework and provides a twig template for the plugin.

Latest Stable Version Latest Unstable Version License

Installation

Install the latest version with

$ composer require nietonfir/raygun-bundle

Configuration

Add your raygun api-key in parameters.yml:

# app/config/parameters.yml
parameters:
    […]
    raygun_api_key: <your_raygun_api-key>

Update config.yml with the following configuration:

# app/config/config.yml
nietonfir_raygun:
    api_key: %raygun_api_key%

Enable the bundle:

// app/AppKernel.php
$bundles = [
    […]
    new Nietonfir\RaygunBundle\NietonfirRaygunBundle(),
];

Basic Usage

Register the raygun monolog handler in config_prod.yml as the first monolog handler.

# app/config/config_prod.yaml
monolog:
    handlers:
        raygun:
            type: service
            id:   raygun.handler
        main:
            type:         fingers_crossed
            action_level: error
            handler:      nested

To use the JavaScript client include the bundled views in your template at their designated places according to the raygun documentation. NietonfirRaygunBundle:Static:raygun-js.html.twig provides the javascript client and NietonfirRaygunBundle::setup.html.twig configures it, e.g.:

{# snip #}
{% include 'NietonfirRaygunBundle:Static:raygun-js.html.twig' %}
</head>
<body>

{# snip #}
{% include 'NietonfirRaygunBundle::setup.html.twig' %}
</body>

If you wish to override any part of the templates you can use the default Symfony mechanisms. A global twig parameter (raygun_api_key) is exposed by a custom Twig_Extension that provides the API key. Raygun pulse can be enabled by either setting or passing a truthy variable named enable_pulse to the template:

{% include 'NietonfirRaygunBundle::setup.html.twig' with {'enable_pulse': true} only %}

Configuration Reference

# app/config/config.yml
nietonfir_raygun:
    api_key: %raygun_api_key% # Your Raygun API key, available under "Application Settings" in your Raygun account.
    async: true               # Sets the [async configuration option](https://github.com/MindscapeHQ/raygun4php#sending-method---asyncsync) on the Raygun client.
    debug_mode: false         # Sets the [debug configuration option](https://github.com/MindscapeHQ/raygun4php#debug-mode) on the Raygun client.
    ignore_404: false         # Whether to send 404 exceptions (NotFoundHttpException) to Raygun

raygunbundle's People

Contributors

emarref avatar mbunzel avatar nietonfir avatar

Stargazers

Matteo avatar

Watchers

 avatar James Cloos avatar Matteo avatar

Forkers

mbunzel belkalab

raygunbundle's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.