PHP code example of kelemen / errbit-php

1. Go to this page and download the library: Download kelemen/errbit-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kelemen / errbit-php example snippets

 php
rbit::instance()
  ->configure(array(
    'api_key'           => 'YOUR API KEY',
    'host'              => 'YOUR ERRBIT HOST, OR api.airbrake.io FOR AIRBRAKE',
    'port'              => 80,                                   // optional
    'secure'            => false,                                // optional
    'project_root'      => '/your/project/root',                 // optional
    'environment_name'  => 'production',                         // optional
    'params_filters'    => array('/password/', '/card_number/'), // optional
    'backtrace_filters' => array('#/some/long/path#' => '')      // optional
  ))
  ->start();
 php
try {
  somethingErrorProne();
} catch (Exception $e) {
  Errbit::instance()->notify(
    $e,
    array('controller'=>'UsersController', 'action'=>'show')
  );
}
 php
Errbit::instance()->notify($exception);
 php
Errbit::instance()->start(array('error', 'fatal')); // using our own exception handler