Usage with CakePhp and Sentry
jeremyhalin opened this issue · comments
I put this:
$isCli = PHP_SAPI === 'cli';
if ($isCli) {
(new \Josegonzalez\ErrorHandlers\Cake\ConsoleErrorHandler(Configure::read('Error')))->register();
} else {
(new \Josegonzalez\ErrorHandlers\Cake\ErrorHandler(Configure::read('Error')))->register();
}
But where do I put config array for Sentry ? Like this:
// Create an array of configuration data to pass to the handler class
$config = [
'handlers' => [
// *Can* be the class name, not-namespaced
// The namespace will be "interpolated" in such cases
'NewrelicHandler' => [
],
// Can also include the full namespace
'Josegonzalez\ErrorHandlers\Handler\BugsnagHandler' => [
'apiKey' => 'YOUR_API_KEY_HERE'
],
// Invalid handlers will be ignored
'InvalidHandler' => [
],
],
];
// Register the error handler
(new \Josegonzalez\ErrorHandlers\Handler($config))->register();
You would create a SentryHandler
stanza in the handlers
key. The setup you pasted is an example of the various ways you can setup an exception handler.
@josegonzalez What is the best way for CakePHP + Sentry please ? Do you have an exampe ?
Thanks.
@josegonzalez Can you please help me ? :)
I'm closing this in favor of #20.