I’m developing a php application and I have created logging feature for it. I mean everytime that something wents wrong I write it in my log file so if an user reports a bug, I can use my log file to trace that bug.
The problem is that if I upload my project on production server, I have to disable PHP’s default error display; I just want to log php errors inside my own log file alongside of webserver’s ‘error.log’. Is there any way so I can do that?
For FEATURED USABLE EXCEPTIONS (i’m calling full featured usable exceptions, (without stack trace)):
Set if you are developer to:
In production this will also should be to true, but modified of code to not show errors on end users. (use:
error_reporting(0); ini_set('display_errors', false)on top of page));First set main function for handling exceptions:
Function for calling handler of exception:
Class exceptionhandler:
Exception.tpl