Dmitry Php
Dmitry Php

Reputation: 39

How to switch on debug mode in CakePHP 3?

I am setting $debug to true in app.php, but nothing changes.

How can I enable debug mode in CakePHP?

Upvotes: 3

Views: 8217

Answers (2)

opendna
opendna

Reputation: 61

app_local.php overwrites app.php. Look for the 'DEBUG', true there.

Upvotes: 1

Lebr1
Lebr1

Reputation: 51

According to the cookbook, you can enable or disable the debug mode by changing the value of the "debug" parameter in the config/app.php file.

/**
 * 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),

And in your controller, you can do logging using the log() method (avalaible for all objects) :

$this->log('debug message','debug');

Upvotes: 2

Related Questions