Welcome Guest, Not a member yet? Register   Sign In
Send Codeigniter error messages to public_thml/error_log

   <div id="container">
       <h1><?php echo $heading; ?></h1>
       <?php echo $message; ?>

<h4>A PHP Error was encountered</h4>

<p>Severity: <?php echo $severity; ?></p>
<p>Message:  <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>

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.


Error message in error log:
[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

[font=Arial,]Error message in view:[/font]
Error Number: 1146

Table 'facebook.myusertable' doesn't exist

SELECT * FROM `myusertable` WHERE `mail` = '[email protected]' AND `password` = 'd3456.$789c09d$.3c1c19e8e1c$.de'

Filename: libraries/my_login.php

Line Number: 21

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:
[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

Theme © iAndrew 2016 - Forum software by © MyBB