Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you log php errors with CakePHP when debug is 0?

I would like to log PHP errors on a CakePHP site that has debug = 0. However, even if I turn on the error log, like this:

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
log_errors = On

it doesn't log errors.

The problem is that even for a parse error that should cause the CakePHP environment to not load completely (I think), it still blocks the error from being logged. If I set debug to 3, it logs to the file without issue.

I am using CakePHP 1.2. I know this is apparently made easier in 1.3, but I'm not ready to upgrade.

like image 632
Justin Avatar asked Jul 01 '26 23:07

Justin


1 Answers

Another way to keep track of and log errors would be to use the Referee plugin as it provides a way to arbitrarily log and catch all (including fatal) errors that occur during exection.

like image 122
joebeeson Avatar answered Jul 04 '26 14:07

joebeeson