Avoid recording errors and debug logs on CakePHP 2

后端 未结 1 1929
太阳男子
太阳男子 2021-01-25 07:10

I am using an small hosting with only 200Mb of space and the error.log and debug.log files placed in \"App/tmp/logs\" are increasing in size very fast. Now their size is around

相关标签:
1条回答
  • 2021-01-25 07:45

    The actual solution is to fix the errors and remove the debugging statements so that nothing would be written in the logs. To answer the question literally, you can configure the error handler to not log anything in core.php:

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

    Or, since you're running a cron job every 2 minutes anyway, delete the logs at the same time.

    0 讨论(0)
提交回复
热议问题