CodeIgniter default environment is development and so error reporting by default in turn on state, if you want to turn off reporting then change the environment value(in the top of the main index.php) to production or testing.
The above method will work with only For >= 2.x ci version. For < 2.x edit the top level index.php and adjust the error_reporting function to use E_ALL.Instead of E_ALL, you can change it to any of the predefined error constant.
Database Errors
The PHP errors are off, but any MySQL errors are still going to show. To turn these off , go to the application/config/database.php file and then Set the db_debug option to false:
So, if the error messages are hidden, how else can we tell if something is not working right? Well, CI can writes out any errors it encounters into its log file. You can configure your CI log file by going to the config.php file in your applications/config directory and set value to
Note: Make your /application/logs folder writable
$config['log_threshold']
.Note: Make your /application/logs folder writable
Threshold options are: You can enable error logging by setting a threshold over zero. The threshold determines what gets logged. Threshold options are:
0 = Disables logging, Error logging TURNED OFF
1 = Error Messages (including PHP errors)
2 = Debug Messages
3 = Informational Messages
4 = All Messages
1 = Error Messages (including PHP errors)
2 = Debug Messages
3 = Informational Messages
4 = All Messages
You can also pass in a array with threshold levels to show individual error types
array(2) = Debug Messages, without Error Messages
For a live site you’ll usually only enable Errors (1) to be logged otherwise your log files will fill up very fast.
- See more at: https://arjunphp.com/error-reporting-handling-in-codeigniter/#sthash.jhXRoqHP.dpuf
No comments:
Post a Comment