I\'m not sure if it was asked, but I couldn\'t find anything like this.
My program uses a simple .txt file for log purposes, It just creates/opens a file and appends
A fairly standard way to deal with logging from an application into a plain text file is to:
This keeps the size of the active log manageable. And then you can just have expiry rules so that old logs get thrown away on a regular basis.
In addition it would be a good idea to have different log levels for your application (info/warning/error/fatal) so that you're not logging more than is necessary.