Last active
December 14, 2015 09:50
-
-
Save brianr/5067629 to your computer and use it in GitHub Desktop.
Example usage of rollbar.php with a logger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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