kinnellholdings/cakephp-error-handler

There is no license information available for the latest version (dev-master) of this package.

dev-master 2019-07-02 14:13 UTC

This package is not auto-updated.

Last update: 2024-06-26 14:51:21 UTC


README

Exceptions

Stops CakePHP from logging 404 errors with a 10 line stack trace.

Usage:

Install via composer and in app/Config/core.php replace:

Configure::write('Exception', array(
    'handler' => 'ErrorHandler::handleException',
    'renderer' => 'ExceptionRenderer',
    'log' => true
));

With:

Configure::write('Exception', array(
    'handler' => '\Kinnell\KinnellErrorHandler::handleException',
    'renderer' => 'ExceptionRenderer',
    'log' => true
));

Errors

Replace:

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

With (non-standard):

Configure::write('Error', [
  'handler'  => '\Kinnell\KinnellErrorHandler::handleError',
  'level'    => E_ALL,
  'log'      => true, // Send error/notice to syslog via CakeLog
  'trace'    => true, // Send error/notice trace to syslog via CakeLog
  'send_err' => true, // Send error/trace as part of the response
]);