Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is codeigniter not logging error!

For some reason I cannot get the error logging to work, I'm getting the white screen of death and I'm hoping an error log will be able to shed some light on the situation!

My index.php has

error_reporting(E_ALL);

I have also made sure that the system/logs directory has appropriate permissions,

If the page fails to load like whats happening does an error even GET logged? If it doesn't I have a huge amount of code that I would have to search through for syntax errors, any advice on how to make the php errors spit out would help!

Also, Here's my config

`
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to 
| determine what gets logged. 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
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 1;

/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/logs/ folder.  Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
`

All that's in my system/logs is an index.html which has a 403 error in it.

like image 785
Doug Molineux Avatar asked Jul 19 '10 00:07

Doug Molineux


People also ask

How do I get errors in CodeIgniter?

You can find the log messages in application/log/. Make sure that this directory is writable before you enable log files. Various templates for error messages can be found in application/views/errors/cli or application/views/errors/html.

What is error handling in CodeIgniter?

CodeIgniter lets you build error reporting into your applications using the functions described below. In addition, it has an error logging class that permits error and debugging messages to be saved as text files. Note. By default, CodeIgniter displays all PHP errors.


1 Answers

If the page is failing to load because of a parse error, then it'll never execute

error_reporting(E_ALL);

so you script will never know to output the error. Edit your php.ini file to make sure you have:

error_reporting = E_ALL
error_log = "/path/to/some/apache/writable/file"
like image 154
Mike Sherov Avatar answered Nov 07 '22 05:11

Mike Sherov