Skip to content

Instantly share code, notes, and snippets.

@brianr
Last active December 14, 2015 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianr/5067629 to your computer and use it in GitHub Desktop.
Save brianr/5067629 to your computer and use it in GitHub Desktop.
Example usage of rollbar.php with a logger
<?php
require_once('rollbar.php');
class EchoLogger {
public function log($level, $message) {
echo "[Rollbar] $level $message\n";
}
}
$config = array(
'access_token' => 'aaaabbbbccccddddeeeeffff00001111',
'environment' => 'test',
'root' => '/Users/brian/testrollbar',
'logger' => new EchoLogger()
);
Rollbar::init($config);
try {
throw new Exception("hello");
} catch (Exception $e) {
Rollbar::report_exception($e);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment