Hi,
Unfortunately there isn’t any “simply” way, how to do it according your expectation.
I would like to recommend use “log rotate” technique:
Create one file and fill it by e.g. 10000 records. After that you should create new file and fill it by another 10000 records. In case of new record (20001), you can rewrite oldest file (delete oldest file and create new)…
This allows you to keep at least 10000 records in two files without any specific resource overhead.
Of course, this technique could be much more flexible. In typical case: we create log file every day (second/minute/hour/week) and files older than one weak are deleted.
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------