Skip to content

ProspectOne/yassa-rollbar

 
 

Repository files navigation

yassa-rollbar

Build Status Dependency Status

This is ZF3 module that implements the notifier for Rollbar v.1.0. Catches and reports exceptions to Rollbar.com for alerts, reporting, and analysis.

Requirements

Installation

By cloning project

  1. Install the rollbar-php by cloning it into ./vendor/.
  2. Clone this project into your ./vendor/ directory.

With composer

  1. Add this project in your composer.json:

    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/ProspectOne/yassa-rollbar"
        },
    ],

    ...

    "require": {
        "prospect-one/yassa-rollbar": "dev-master"
    }
  2. Install this package by running the command:

    $ php composer.phar update

Post installation

  1. Enabling it in your application.config.phpfile.

    <?php
    return array(
        'modules' => array(
            'Yassa\Rollbar', // must be added as the first module
            // ...
        ),
        // ...
    );
  2. Copy config/module.yassa.rollbar.global.php.dist in project/directory/config/autoload/ and remove .dist extension.

Options

The following options are available at that configuration file:

Yassa options:

  • enabled - Switch On/Off module
  • errorhandler - Register Rollbar as an error handler to log PHP errors
  • exceptionhandler - Register Rollbar as an exception handler to log PHP exceptions
  • shutdownfunction - Register Rollbar as an shutdown function

Rollbar 1.0 options, full list can be found at: rollbar-php Configuration references :

  • access_token - Your project access token
  • base_api_url - The base API url to post to. (default: https://api.rollbar.com/api/1/)
  • branch - Name of the checked-out branch.
  • capture_error_stacktraces - Record full stacktraces for PHP errors. (default: true)
  • environment - Environment name. Any string up to 255 chars is OK. For best results, use "production" for your production environment. (default: production)
  • error_sample_rates - Associative array mapping PHP error numbers to sample rates. Sample rates are ratio out of 1, e.g. 0 is "never report", 1 is "always report", and 0.1 is "report 10% of the time". Sampling is done on a per-error basis. (default: array(), meaning all errors are reported.)
  • host - Server hostname. (default: null, which will defer to a call to gethostname() (or php_uname('n') if that function does not exist))
  • logger - An object with a log($level, $message) method. Will be used by RollbarNotifier to log messages. errors E_USER_NOTICE or higher. (default: -1 (report all errors))
  • person - An associative array describing the currently-logged-in user. Required: id, optional: username, email. All values are strings.
  • person_fn - A function reference (string, etc. - anything that call_user_func can handle) returning an array like the one for 'person'
  • root - Absolute path to the root of your application, not including the final /.
  • scrub_fields - Array of field names to scrub out of POST. Values will be replaced with astrickses. If overridiing, make sure to list all fields you want to scrub, not just fields you want to add to the default. Param names are converted to lowercase before comparing against the scrub list. (default: array('passwd', 'password', 'secret', 'confirm_password', 'password_confirmation'))
  • shift_function - Whether to shift function names in stack traces down one frame, so that the function name correctly reflects the context of each frame. (default: true)
  • timeout - Request timeout for posting to Rollbar, in seconds. (default: 3)

About

Zend Framework 2 module for connect to Rollbar service

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%