PHPackages                             snapshotmedia/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. snapshotmedia/cake-sentry

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

snapshotmedia/cake-sentry
=========================

CakePHP Sentry Plugin

2711PHP

Since Oct 14Pushed 11y ago18 watchersCompare

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

READMEChangelogDependenciesVersions (1)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)

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

[](#installation)

1. Install Sentry Plugin into your CakePHP project :

```
	git submodule add http://github.com/Sandreu/cake-sentry app/Plugin/Sentry
	cd app/Plugin/Sentry
	git submodule init
	git submodule update
```

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-dns-for-PHP'
		),
		'javascript' => array(
			'server'=>'http://your-sentry-dns-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 :

```
