composer require pieceofcake2/sentry
Config/core.php
Configure::write('Sentry', [
'dsn' => 'SENTRY_DSN',
'options' => [
'environment' => 'SENTRY_ENVIRONMENT',
'release' => 'SENTRY_RELEASE',
],
'ignoredExceptions' => [
NotFoundException::class,
MissingControllerException::class,
MissingActionException::class,
]
]);
App::uses('SentryErrorHandler', 'Sentry.Lib/Error');
Configure::write('Error', [
'handler' => 'SentryErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED,
'trace' => true,
]);
Configure::write('Exception', [
'handler' => 'SentryErrorHandler::handleException',
'renderer' => 'ExceptionRenderer',
'log' => true,
]);