Send Codeigniter error messages to public_thml/error_log |
views/errors/error_db.php
Code: <body> views/errors/error_php.php Code: <h4>A PHP Error was encountered</h4> I want to overide this view file to show custom messages ($message, $filepath and $line in error_db.php and error_php.php). I don't want to serve a lot information about my files and db data structure. But when I do that, my visitor can't trease what is causing error, so information can't provided by them to admin. In the same time, error messages provided here have a more details, make it easy to find a problerm that causing php and db error; than a messages usually I get in public_html/error_log file when some error encountered. Example: Error message in error log: Code: [02-Aug-2017 06:41:29 America/Chicago] PHP Fatal error: Call to a member function num_rows() on boolean in /home9/markzuckberg/public_html/application/libraries/my_login.php on line 23 Error message in view: Code: Error Number: 1146 How to send this PHP and DB error messages to error_log? When visitor facing any error. So by that, i can check any error on my application easily with more details without reported. maybe in this format for DB Error: Code: [02-Aug-2017 06:41 America/Chicago] Table 'facebook.myusertable' doesn't exist - SELECT * FROM `myusertable` WHERE `mail` = '[email protected]' AND `password` = 'd3456.$789c09d$.3c1c19e8e1c$.de' - in libraries/my_login.php - at line 21 |
Welcome Guest, Not a member yet? Register Sign In |