CodeIgniter Forums
Error_Reporting level being ignored when using custom error handler - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forum-18.html)
+--- Thread: Error_Reporting level being ignored when using custom error handler (/thread-63797.html)



Error_Reporting level being ignored when using custom error handler - mr_pablo - 12-10-2015

I have written a basic library that sets a custom error handler, using `set_error_handler()`, that allows me to log the errors myself.

As expected, with `error_reporting(E_ALL)` set, I get logs for simple PHP notices (such as an undefined variable).

However, if I change the level to `E_ERROR`, I am still seeing the notices in the error logs.

If I remove my custom error handler, the logged errors are those that match the error_reporting.

So why isn't the level being adhered to when using a custom error handler?

Is it something I need to implement in my handler? (As in, the default error handler has code to use the error_reporting level?)