I want error logging in PHP CodeIgniter. How do I enable error logging?
I have some questions:
You can configure your CI log file by going to the config. php file in your applications/config directory and set value to $config['log_threshold'] . For a live site, you'll usually only enable Errors (1) to be logged otherwise your log files will fill up very fast.
No need to type a long query to disable error reporting in codeigniter. Use error_reporting(0); in the page to disable displaying errors in that page.
There are two possible values for error_log: a custom log file and the syslog. If the syslog is used, then all PHP errors will be sent directly to the default system log file—in Linux, this is typically /var/log/syslog.
CodeIgniter has some error logging functions built in.
$config['log_threshold'] = 1;
log_message('error', 'Some variable did not contain a value.');
log_exceptions()
. You can do this yourself or use this. More info on extending the core here See http://www.codeigniter.com/user_guide/general/errors.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With