Where the oldest log file is archived with python protocol
The rolling FileHandler calls the doRollover () method , which checks backupCount
and then removes test.log.3
with os.remove()
.
The functionality of os.remove depends on your system. According to the Python docs os.remove()
will call the operating system unlock functionality and remove the file from disk.
The filesystem probably just marks the sectors as free and removes the file entry from the directory. It all depends on your OS / filesystem implementation.
Edit: For finding deleted files on Linux, you can try debugfs .
source to share
backupCount
is the number of files that are stored. Old files are deleted.
When filled test.log
, it is renamed to test.log.1
.
It is then test.log.1
renamed to test.log.2
, and when it reaches test.log.3
, it is removed on the next rollover.
source to share