Welcome Guest, Not a member yet? Register   Sign In
Errors Not Being Logged
#1

[eluser]vincej[/eluser]
HI - I have checked everything but for some reason my errors are not being written to a log file. They flash momentarily on the screen but nothing in any of the logs, ie CI, Apache nor PHP.

I have checked php.ini and it is set to report all errors and the log file is set.

I have checked index.php and the environment is set to development. config.php has the error log path set to default.

Any ideas

Many thanks !
#2

[eluser]joergy[/eluser]
How do You catch errors?
How do You log them?
Have you tested logging an non-error-message?
#3

[eluser]vincej[/eluser]
In answer to your questions - I rely upon CI to log my errors .... this is the essence of my question. So I am not sure what you are telling me. Thanks !
#4

[eluser]CroNiX[/eluser]
What is the value for $config['log_threshold']?
Is your /application/logs dir writable?
See the big pink note at the bottom of http://ellislab.com/codeigniter/user-gui...rrors.html
#5

[eluser]vincej[/eluser]
Thanks ! That is helpful. I ramped up the threshold from 1 to 4 and yes I now get mountains of stuff being logged.

BUT ... Not the very thing I want most : the error message which flashes by at huge speed. I have since established that this message reads: " An error was encountered. The action you have requested is not allowed" .

So how do I get these "flash messages" to be logged.

#6

[eluser]CroNiX[/eluser]
There must be something in your code that causes it to flash. Sounds like something that would be done with javascript or a timed page refresh. I've never seen that happen.

As for logging that specific error, you'd have to do that manually. "An error was encountered. The action you have requested is not allowed" sounds like the error that is shown when the CSRF token doesn't match, or is missing, when a form is submitted. It's not a PHP error, so it doesn't get logged by PHP. CI tells that error to be shown on the screen. If you want to log it you'd have to extend the /system/core/Security class and override the csrf_show_error() method to log_message() instead of the default show_error() (or in addition to).
#7

[eluser]vincej[/eluser]
Yes - you are right, I am trying to get CSRF to work on a page which uses ajax.

Thanks again - your input is highly appreciated !




Theme © iAndrew 2016 - Forum software by © MyBB