What Is an Error Log?
The error log is a text file used by the software to record runtime error messages. Programmers and maintenance personnel can use the error log to debug and maintain the system.
- Following with
- The following uses PHP as an example to explain how to prevent the system from being attacked by exploiting error logs.
- For PHP developers, once a product is put into use, the display_errors option should be turned off immediately, so as not to be hacked by the path, database connection, data table and other information revealed by these errors. However, after any product is put into use, errors will inevitably occur. So how to record some error reports that are useful to developers? We can log the error report in a separate text file. The error log records can help developers or managers to check whether the system has problems.
- If you need to write the error report in the program to the error log, just enable the configuration instruction log_errors in the PHP configuration file. Error reports are logged to the web server's log file by default.