PHPackages                             sandreu/cake-sentry - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. sandreu/cake-sentry

ActiveCakephp-plugin[Logging &amp; Monitoring](/categories/logging)

sandreu/cake-sentry
===================

Sentry error handler plugin for CakePHP2

0.2.0(10y ago)1640.2k16[2 issues](https://github.com/Sandreu/cake-sentry/issues)[1 PRs](https://github.com/Sandreu/cake-sentry/pulls)BSD 3-ClausePHPPHP &gt;=5.2.8

Since Feb 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Sandreu/cake-sentry)[ Packagist](https://packagist.org/packages/sandreu/cake-sentry)[ Docs](https://github.com/Sandreu/cake-sentry)[ RSS](/packages/sandreu-cake-sentry/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Cake-Sentry
===========

[](#cake-sentry)

**Cake-Sentry** is an error handler plugged on [Sentry](http://www.getsentry.com) - [docs](http://sentry.readthedocs.org/en/latest/quickstart/index.html#setting-up-an-environment)

Compatibility
=============

[](#compatibility)

This library is only compatible with CakePHP &gt;= 2.8 and &lt; 3.0. If you need support for CakePHP &lt; 2.8 please use the 0.1.0 release of cake-sentry.

Installation
------------

[](#installation)

**Note if you don't install from composer you will have to manually download the raven component and install it before proceeding to step 2.**

1. Install Sentry Plugin into your CakePHP project with composer :

```
    // composer.json

    // …

    "require": {
      // …
      "sandreu/cake-sentry": "*"
    },

    // …
```

2. Load the cake-sentry Plugin in your *bootstrap.php* :

```
	CakePlugin::load('Sentry');
```

3. Configure the error handler in your *core.php* :

```
	App::uses('SentryErrorHandler', 'Sentry.Lib');

	Configure::write('Sentry', array(
		'production_only' => false, // true is default value -> no error in sentry when debug
		'avoid_bot_scan_errors' => 'MissingController or MissingPlugin error message', // or false if you want Sentry to log MissingController and MissingPlugin Exceptions
		'User' => array(
			'model' => 'SpecialUser', // 'User' is default value
			'email_field' => 'special_email' // default checks 'email' and 'mail' fields
		),
		'PHP' => array(
			'server'=>'http://your-sentry-DSN-for-PHP'
		),
		'javascript' => array(
			'server'=>'http://your-sentry-DSN-for-javascript'
		)
	));

	Configure::write('Error', array(
		'handler' => 'SentryErrorHandler::handleError',
		'level' => E_ALL & ~E_DEPRECATED,
		'trace' => true
	));

	Configure::write('Exception', array(
		'handler' => 'SentryErrorHandler::handleException',
		'renderer'=>'ExceptionRenderer'
	));
```

4. Use Sentry as logger :

```
	CakeLog::config('default', array('engine' => 'Sentry.SentryLog'));
```

5. include ravenjs and init script in the default layout :

```
