cyphun
cyphun

Reputation: 163

CakePHP debug set to 0, but it's still debuggin

My cake setup has debug set to 0, but it's still debugging to app/tmp/logs/debug.log. Just to make sure there was no voodoo going on, I even printed out Configure::read('debug') and it spits out 0. Does anyone have any idea why this would be happening? Here is a repeated log result from this debug log:

2013-02-15 01:25:41 Notice: Strict (2048): Non-static method App::_loadVendor() should not be called statically in [/var/www/website/htdocs/lib/Cake/Core/App.php, line 614]
Trace:
App::_loadVendor() - CORE/Cake/Core/App.php, line 614
App::import() - CORE/Cake/Core/App.php, line 614
include - APP/View/Helper/AdHelper.php, line 3
App::load() - CORE/Cake/Core/App.php, line 497
spl_autoload_call - [internal], line ??
class_exists - [internal], line ??
HelperCollection::load() - CORE/Cake/View/HelperCollection.php, line 75
View::loadHelpers() - CORE/Cake/View/View.php, line 577
View::render() - CORE/Cake/View/View.php, line 359
Controller::render() - CORE/Cake/Controller/Controller.php, line 898
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 114
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 89
[main] - APP/webroot/index.php, line 96

Also I am using PHP 5.4, and am running CakePHP 2.3.

Thanks.

Upvotes: 0

Views: 1544

Answers (2)

gazareth
gazareth

Reputation: 1154

If you set debug to 0, any calls to debug() or Debugger::log will write to debug.log (unless you have overwritten the default). Whereas, with debug greater than 0, calls to debug() will display as flash messages in the browser (at the top of the view if called from Model or Controller and in-line if called from View).

You can define what type of errors go into which log in bootstrap.php:

App::uses('CakeLog', 'Log');
CakeLog::config('debug', array(
    'engine' => 'FileLog',
    'types' => array('info', 'debug', 'notice'),
    'file' => 'debug',
));
CakeLog::config('error', array(
    'engine' => 'FileLog',
    'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
    'file' => 'error',
));

By default Cake places 'notice' in the types array for the 'debug' CakeLog::config, meaning that notices go into debug.log. Copy 'notice' into the types array for the 'error' config and it should place notices in error.log instead.

Upvotes: 0

Rikesh
Rikesh

Reputation: 26421

Make sure you are completely (for every controllers & actions) turning off your debugging mode. Try this code in your cake core.php file.

Configure::write('Error', array(
    'handler' => 'ErrorHandler::handleError',
    'level' => 0,
    'trace' => false
));

For more details check here.

Upvotes: 1

Related Questions