I have an application which will write to a particular log file as long as the user session is running. What i am looking for is to put a max cap on the size of a log file so it does not grow beyond a particular size. Two scenarios which will be useful are:
Any utility which keeps an eye on the log file and as soon as it reaches the max size start truncating the file content from the start so the application can keep appending the content at the end.
Any utility which supports when creating the file I can specify the max size of that file and when the file reaches that maxsize it should simply not grow beyond that point.
What I don't want is...
...to set up a cron job or a script which will monitor the file size after a particular interval of time (say 1 hour) and then delete its contents at that time.