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

I would like to register PHP errors on the CakePHP website with 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 does not register errors.

The problem is that even for a parsing error that should cause the CakePHP environment to not load completely (I think), it still blocks the error during registration. If I set the debugging to 3, it will load into the file without any problems.

I am using CakePHP 1.2. I know that this seems to have become easier in 1.3, but I'm not ready for an update.

+3
source share
5 answers

-, ( ) , .

+2

define ('LOG_ERROR', 2); core.php

0

PHP , CakePhp.

/etc/php.ini ( ) error_log. , PHP .

0

CakePHP 1.2-1.3 , / PHP , .

cake/libs/view/view.php # 664

@include ($___viewFn);

@ . :

include ($___viewFn);

That allows you to create PHP errors / warnings in the code of view and subsequently register. Once I changed this and had the correct logging options in core.php, I was finally able to get full production logs.

0
source

Sometimes there may be a different reason. For example, the structure used may have its own internal caching module, which stores the value in the buffer as you continue to try. Check if duplicate copies are generated or not. Usually these files are called filename.ext.r123 etc.

-1
source

Source: https://habr.com/ru/post/1790118/


All Articles