PHP Error Reporting Production vs Development

后端 未结 2 1973
南方客
南方客 2020-12-10 06:21

What is best practice when setting error reporting on development and production applications? At the moment I have the following:

// development
error_repor         


        
2条回答
  •  不思量自难忘°
    2020-12-10 06:55

    For the best error logging experience, set error_reporting to -1 (absolutely everything), turn display_errors off, and set a custom error_log.

    Then in the terminal, type tail -f /path/to/error_log. Your notices, warnings and errors will now scroll past in real time, without distorting your web page's display.

    It's always worth logging everything. In any environment.

提交回复
热议问题