EllisLab/CodeIgniter — pull request #2633 by kaiwangchen (2013-09-11 05:55:37+00:00)
Title: Simulate a complete custom exception handler by redirecting uncaught events

Due to inherent shortcoming of [custom error handler](http://php.net/manual/en/function.set-error-handler.php), CodeIgniter's current logging feature cannot capture certain PHP parse errors, which for instance can be triggered by failing to load application controllers with false filename casing. These events are caught by the standard PHP error handler.

Why not make a complete custom error handler? The trick is explained in [this article](http://insomanic.me.uk/post/229851073/php-trick-catching-fatal-errors-e-error-with-a) recommended by @vlakoff in #2516.

With a complete handler, one feels free to keep error_reporting(0) for production environment as in 2.1.4 release, or goes well with an inhibiting php.ini, without missing critical events. Critical events are errors, aren't they? Find below $config['log_threshold'] options (0 is the default).

0 = Disables logging, Error logging TURNED OFF
1 = Error Messages (including PHP errors)
2 = Debug Messages
3 = Informational Messages
4 = All Messages

The pay is duplicated critical events in application logs and PHP error log, if error_reporting is not set to zero.