PHP CodeIgniter Error Log Not working properly PHP CodeIgniter Error Log Not working properly codeigniter codeigniter

PHP CodeIgniter Error Log Not working properly


Please check your config/config.php file and check your settings

$config['log_threshold'] = 4;**Note :**  0 = Disables logging, Error logging TURNED OFF1 = Error Messages (including PHP errors)2 = Debug Messages3 = Informational Messages4 = All Messages


I'm not completely sure, but I think you are mixing two things together.

error_reporting in php settings shows you errors created during php script execution.If you use "desplay_errors" = Off. PHP won't show any of those errors. You have turned on log_errors and setup a folder. So PHP error will get to the /var/log/php_errors.log file.

On the other hand CodeIgniter uses function:

log_message('level,'message')

which serves for storing errors/debug/info into log files. If you call

log_message('error','I'm an error!')

somewhere in your code, you really should have a new log file in log directory.

Internaly CodeIgniter uses log_message() if there are any PHP errors. I'm really not sure how it will behave while display_error is set to Off (he will think that there was no error?).

Try calling your own log_message and turn display_errors to On. I think that it should help.


You have to set error_reporting(E_ALL); under case 'production' in your index.php file