List of steps to reproduce (step by step, including full links if applicable):
- Run a script with -log enabled
What happens?:
If the file maximum size is exceeded only backup files with <scriptname>.1.log and <scriptname>.99.log are created where 1.log is newer than 99.log.
What should have happened instead?:
def doRollover(self): """Modified naming system for logging files. Overwrites the default Rollover renaming by inserting the count number between file name root and extension. If backupCount is >= 1, the system will successively create new files with the same pathname as the base file, but with inserting ".1", ".2" etc. in front of the filename suffix. For example, with a backupCount of 5 and a base file name of "app.log", you would get "app.log", "app.1.log", "app.2.log", ... through to "app.5.log". The file being written to is always "app.log" - when it gets filled up, it is closed and renamed to "app.1.log", and if files "app.1.log", "app.2.log" etc. already exist, then they are renamed to "app.2.log", "app.3.log" etc. respectively. If backupCount is == -1 do not rotate but create new numbered filenames. The newest file has the highest number except some older numbered files where deleted and the bot was restarted. In this case the ordering starts from the lowest available (unused) number. """
Background
config.py setting is:
# Number of rotating logfiles are created. The older files get the higher # number. If logfilecount is 0, no logfile will be archived but the current # logfile will be overwritten if the file size reached the logfilesize above. # If logfilecount is -1 there are no rotating logfiles but the files where # renamed if the logfile is full. The newest file gets the highest number until # some logfiles where deleted. ############## LOGFILE SETTINGS ############## log = ['*'] logfilesize = 4096 logfilecount = 99