Mirko Pagliai
Mirko Pagliai

Reputation: 1241

CakePHP: request URL for debug.log

I noticed that into error.log is shown the request url, while it doesn't happen into debug.log.

For example, error.log:

2016-01-13 16:23:31 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Posts could not be found.
Request URL: /posts/view/45
Stack Trace:
#0 /var/www/mysite/webroot/index.php(37): Cake\Routing\Dispatcher->dispatch(Object(MeTools\Network\Request), Object(Cake\Network\Response))
#1 {main}

Instead, debug.log:

2016-01-13 21:18:54 Notice: Notice (8): Trying to get property of non-object in [/var/www/mysite/vendor/mirko-pagliai/me-cms/src/Template/Posts/view.ctp, line 26]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 140
include - ROOT/vendor/mirko-pagliai/me-cms/src/Template/Posts/view.ctp, line 26
Cake\View\View::_evaluate() - CORE/src/View/View.php, line 992
Cake\View\View::_render() - CORE/src/View/View.php, line 952
Cake\View\View::render() - CORE/src/View/View.php, line 587
MeCms\View\View\AppView::render() - ROOT/vendor/mirko-pagliai/me-cms/src/View/View/AppView.php, line 92
Cake\Controller\Controller::render() - CORE/src/Controller/Controller.php, line 611
Cake\Routing\Dispatcher::_invoke() - CORE/src/Routing/Dispatcher.php, line 120
Cake\Routing\Dispatcher::dispatch() - CORE/src/Routing/Dispatcher.php, line 87
[main] - ROOT/webroot/index.php, line 37

This is not good for me, because I cannot replicate the notice and I cannot understand in what cases it happens.

Why this? How to do?

Upvotes: 0

Views: 548

Answers (1)

DIDoS
DIDoS

Reputation: 822

The differences between those two errors is that the first one is a CakePHP generated Exception and the second is a CakePHP error (severity notice). You can write your own error handler see this.

Upvotes: 1

Related Questions