Welcome Guest, Not a member yet? Register   Sign In
PHP Error Logging Not Working.
#1

[eluser]zechdc[/eluser]
How do I get php errors to show up in the error log?

In my config file I have set the following:
Code:
$config['log_threshold'] = 4;

When I load a page, which I intentionally made a sytax mistake on, I expect it to be logged in the logs folder.

This is the error I receive when I go to that page in the browser:
Quote:Parse error: syntax error, unexpected T_STRING in /Applications/MAMP/htdocs/v3/application/views/includes/header.php on line 11

This is what the error log says:
Quote:DEBUG - 2011-02-14 15:52:13 --> Config Class Initialized
DEBUG - 2011-02-14 15:52:13 --> Hooks Class Initialized
DEBUG - 2011-02-14 15:52:13 --> Utf8 Class Initialized
DEBUG - 2011-02-14 15:52:13 --> UTF-8 Support Enabled
DEBUG - 2011-02-14 15:52:13 --> URI Class Initialized
DEBUG - 2011-02-14 15:52:13 --> Router Class Initialized
DEBUG - 2011-02-14 15:52:13 --> No URI present. Default controller set.
DEBUG - 2011-02-14 15:52:13 --> Output Class Initialized
DEBUG - 2011-02-14 15:52:13 --> Input Class Initialized
DEBUG - 2011-02-14 15:52:13 --> Security Class Initialized
DEBUG - 2011-02-14 15:52:13 --> XSS Filtering completed
DEBUG - 2011-02-14 15:52:13 --> Global POST and COOKIE data sanitized
DEBUG - 2011-02-14 15:52:13 --> Language Class Initialized
DEBUG - 2011-02-14 15:52:13 --> Loader Class Initialized
DEBUG - 2011-02-14 15:52:13 --> Helper loaded: url_helper
DEBUG - 2011-02-14 15:52:13 --> Helper loaded: form_helper
DEBUG - 2011-02-14 15:52:13 --> Database Driver Class Initialized
DEBUG - 2011-02-14 15:52:13 --> Controller Class Initialized
#2

[eluser]Jaketoolson[/eluser]
Quote:Note: By default, CodeIgniter displays all PHP errors. You might wish to change this behavior once your development is complete. You'll find the error_reporting() function located at the top of your main index.php file. Disabling error reporting will NOT prevent log files from being written if there are errors.

As taken from Error Handling doc.

What happens if you change error_reporting to 0 and leave $config['log_threshold'] to 4? Is the error then logged? Also, you might want to add a function to the 404 and general_error views to log the error if it still isn't occuring.
#3

[eluser]zechdc[/eluser]
I changed error_reporting(E_ALL); to error_reporting(0); in the index.php.
I left $config['log_threshold'] = 4; in the config.php alone.

Still not being logged.

Also, I have set display_errors in php.ini to On
#4

[eluser]billmce[/eluser]
I upgraded to 2.0.1 yesterday ... and today I can't get logging to work. :-(
I do notice that the ...system/logs folder that I created has the 'readonly' property set. I'm not sure why I can't unset that property.
#5

[eluser]InsiteFX[/eluser]
If its a Windows system right click on the directory name and on the bottom click on the read only until it clears from the blue color.

InsiteFX
#6

[eluser]billmce[/eluser]
It is windows -- a test system.

I have tried that ... and it appears to work with the check box being properly cleared.
However, if I immediately go back into properties it shows that my changes have had no effect.

I've tried clearing the readonly attribute on parent folders thinking that might be part of the problem but other than appearing to work as above, nothing is changed.

FWIW, Xampp.
#7

[eluser]InsiteFX[/eluser]
Give yourself Administrator rights do a search for tweak UI best app around ofr that stuff

Ultimate Windows Tweaker

InsiteFX
#8

[eluser]Akinzekeel[/eluser]
I have the same problem as billmce, running XAMPP with Windows and CI 2.0.1. My system/logs folder is empty although I do encounter PHP errors. It worked fine on CI 2.0.0.

In the properties of the logs folder the readonly-checkbox is grey but checked. When I uncheck it, click apply and re-open the folder's property dialog, it's checked again.

However I also noticed that all other folders inside htdocs have this readonly attribute set and CI is able to create cache files and thumbnails just fine, so when all the other folders are writable, why not the logs folder?

@InsiteFX: I downloaded the tool you suggested but it does not start.
#9

[eluser]InsiteFX[/eluser]
It's only for Windows Vista and Windows 7!

InsiteFX
#10

[eluser]John_Betong_002[/eluser]
This thread maybe relevant:

http://ellislab.com/forums/viewthread/182313/#873012
 
 
 




Theme © iAndrew 2016 - Forum software by © MyBB