84 Sometimes we need to record the operation of an operation event of the user or back-end, you can use the back-end language such as PHP to log the operation results to the log file, easy to test and find the problem. In particular, these are running in the back-end and the front can not directly see the results of the operation, then you can use the log file to record, if you often interface with some interfaces such as paypal interface, amazon card interface, log records will be not enough.
We talk about PHP log records, log information is written to a log file, different from the memory log. The process of writing to the log is to open the log file (newly created if it does not exist), then append the log content to the back of the log file, and finally close the log file.
In this article, we save the contents of the log in json format for easy reading directly when needed.