Log file rotation

Log file rotation takes place when a log file is growing too large: a new log file is opened and the old log file is backed up by appending ".1" to its name. Existing backup log files get a higher number; if the maximum number is reached, the corresponding log file is deleted during rotation.

Example

The log file name is "LNTransferService.log". The maximum file size is 1MB and the maximum number of log files is 10. 10 backup files are already present: LNTransferService.log.1 - LNTransferService.log.10.

If the log file reaches its maximum size of 1 MB, LNTransferService.log is renamed to LNTransferService.log.1. The existing LNTransferService.log.1 is renamed to LNTransferService.log.2, and so on. LNTransferService.log.9 is renamed to LNTransferService.log.10, and the existing LNTransferService.log.10 is deleted.