I am using CakePHP 3.0 framework and need to disable/turn off Stack Trace if exception or error occurs.
I tried solution given on Turn on /off the debug mode for particular controller in cakephp.
If I make change in MyProject\config\app.php file, stack trace are turned off for all controllers but if I set trace = false using following code for a specific controller Error.trace is set to false but stack trace are not disabled.
<?php
namespace App\Shell;
use Cake\Core\Configure;
use Cake\Console\Shell;
Configure::write('Error.trace', false);
class MyClassShell extends Shell {
public function main() {
echo 'Error.trace...' . Configure::read('Error.trace'); // output is false
...
}
}
?>
Its weird to see that even if Error.trace is False still stack trace are printed.
Is their any other way to disable Stack Trace in Cakephp 3.0 for a specific controller/shell file instead of setting it from app.php ?