【发布时间】:2018-01-11 18:46:15
【问题描述】:
我在 app.php 中将 $debug 设置为 true,但没有任何变化。
如何在 CakePHP 中启用调试模式?
【问题讨论】:
标签: cakephp cakephp-3.0
我在 app.php 中将 $debug 设置为 true,但没有任何变化。
如何在 CakePHP 中启用调试模式?
【问题讨论】:
标签: cakephp cakephp-3.0
根据cookbook,您可以通过更改config/app.php文件中“debug”参数的值来启用或禁用调试模式。
/**
* Debug Level:
*
* Production Mode:
* false: No error messages, errors, or warnings shown.
*
* Development Mode:
* true: Errors and warnings shown.
*/
'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),
在您的控制器中,您可以使用log() method 进行日志记录(适用于所有对象):
$this->log('debug message','debug');
【讨论】:
app_local.php 覆盖 app.php。在那里寻找'DEBUG', true。
【讨论】: