In the development phase, all errors need to be displayed; while in the production phase, all errors need to be hidden and all errors logged
There are two ways to log errors
In php.ini
<code>log_errors = <span>On</span> | Off; <span>//设定是否记录日志</span> errors_log = <span>'*.log'</span>; <span>//设定错误日志文件名,若没有给定路径,则在所有目录下生成日志文件</span><span>//error_log = syslog;</span><span>//将错误日志记录到系统中,windows系统下(事件查看器->windows日志->应用程序)</span></code>
Source In the code program
<code>ini_<span>set</span>(<span>'log_errors'</span>,On); ini_<span>set</span>(<span>'errors_log'</span>,<span>'*.log'</span>); //ini_<span>set</span>(<span>'errors_log'</span>,<span>'*.txt'</span>); //ini_<span>set</span>(<span>'errors_log'</span>,syslog);</code>
The above introduces the error log recording in PHP, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.