Secondly, if this log file has been added by the system, then this file should be locked, and other programs can only read it, not modify or delete it. Therefore, if this happens, you must empty it every few days. First, modify the system that generates the log, and periodically clear the contents of the log file. Second, write a script or program to stop the system first, then clear the log and restart the system. This method is not recommended.
It is strongly recommended to adopt the first method, and then modify your log reader to read only the contents of the log file generated the day before, because the backup file is named by date, and it is easy to get the file name to be read by using this rule.