Current location - Health Preservation Learning Network - Slimming men and women - Problems with java log logs
Problems with java log logs
First, if it is configured to be generated daily, then. The log file will not change. For example, the log file is log.log. The next day, this file will be backed up as 20 13-0 1-07.log, but another log.log file will be generated at the same time, so it will not affect your path.

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.