Welcome Guest, Not a member yet? Register   Sign In
error reporting: I can't get php errors to be logged
#1

[eluser]falmp[/eluser]
I'm testing out the error logging and error handling but with not so much success.

On my index.php I have:

Code:
error_reporting(0);

And on my config.php I have:

Code:
$config['log_threshold'] = 4;

But with a broken controller, I get a blank page and nothing on my log-2009-05-03.php error log (well, only the usual DEBUG messages).

Broken controller:

Code:
<?php

class Home extends Controller {

    function index()
    {
        echo "yargh, this be a broken controller --->"
    }
    
}

If I change error_reporting to E_ALL, I get the PHP error displayed on the browser (and still nothing on the log file).

It seems I can't get CI to properly log the PHP errors or even use the application/errors/error_php.php file.

Any ideas?
#2

[eluser]pistolPete[/eluser]
If PHP fails with a parsing error (like your example above), script execution is aborted by the server, so CodeIgniter can't log anything.
#3

[eluser]falmp[/eluser]
Hmm makes sense, but then in which case the error_php.php page is used? And what about the "php errors" mentioned on the log_message() error level?

Error Messages. These are actual errors, such as PHP errors or user errors.
#4

[eluser]TheFuzzy0ne[/eluser]
Warnings and notices will still be logged, and I think the error will be logged just before the script execution is halted, but I'm not sure.
#5

[eluser]falmp[/eluser]
Ok, will do some further tests on this later.

Thanks for the replies. Smile
#6

[eluser]tomcode[/eluser]
I had similiar behavior, the log folder did not exist / was not writable
#7

[eluser]falmp[/eluser]
Well, it was not my case because I'm on Windows and the log file was being written (just not the PHP errors).




Theme © iAndrew 2016 - Forum software by © MyBB