2017 © Pedro Peláez
 

cakephp-plugin cake-sentry

Sentry error handler plugin for CakePHP2

image

sandreu/cake-sentry

Sentry error handler plugin for CakePHP2

  • Sunday, February 11, 2018
  • by Sandreu
  • Repository
  • 1 Watchers
  • 15 Stars
  • 29,852 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 15 Forks
  • 3 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Cake-Sentry

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

Compatibility

This library is only compatible with CakePHP >= 2.8 and < 3.0. If you need support for CakePHP < 2.8 please use the 0.1.0 release of cake-sentry., (*2)

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., (*3)

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

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

    // …
  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-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'
    ));
  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

11/02 2018

dev-master

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

Sentry error handler plugin for CakePHP2

  Sources   Download

WTFPL BSD 3-Clause

The Requires

 

log cakephp exception sentry error

15/02 2016

0.2.0

0.2.0.0 https://github.com/Sandreu/cake-sentry

Sentry error handler plugin for CakePHP2

  Sources   Download

BSD 3-Clause

The Requires

 

log cakephp exception sentry error

26/02 2015

0.1.0

0.1.0.0 https://github.com/Sandreu/cake-sentry

Sentry error handler plugin for CakePHP2

  Sources   Download

BSD 3-Clause

The Requires

 

log cakephp exception sentry error