2017 © Pedro Peláez
 

cakephp-plugin cake-sentry

CakePHP Sentry Plugin

image

parallax/cake-sentry

CakePHP Sentry Plugin

  • Tuesday, October 14, 2014
  • by MrRio
  • Repository
  • 15 Watchers
  • 2 Stars
  • 1,637 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 15 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Cake-Sentry

Cake-Sentry is an error handler plugged on Sentry - docs, (*1)

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
  1. Load the cake-sentry Plugin in your bootstrap.php :
    CakePlugin::load('Sentry');
  1. 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'
    ));
  1. Use Sentry as logger :
    CakeLog::config('default', array('engine' => 'Sentry.SentryLog'));
  1. include ravenjs and init script in the default layout :
    <?php
    echo $this->Html->script('jquery');
    echo $this->Html->script('ravenjs-min');
    ?>
    <script type="text/javascript">
        $(function () {
            <?php echo $this->element('Sentry.raven-js'); ?>
        });
    </script>

The Versions

14/10 2014

dev-master

9999999-dev https://github.com/parallax/cake-sentry

CakePHP Sentry Plugin

  Sources   Download

MIT

The Requires

 

cakephp behat shell