Well off the top of my head I'd say just run a check on the file when you go to write to it.
Example...
VB Code:
If FileLen(LogFile) > 2048 then 'Logfile = path of your logfile and 2048 'I think is approx 2 megs in bytes lol can't remember offhand. 'Do whatever you want to do with the file to keep it from getting bigger.. 'One thing would be to skip the first line of the file and read in the rest and then save it 'plus the new line back into the file.. 'Depends on how you save as to what line you would skip End If
EDIT:
Assuming your using the same log file writing process as in that link you put in your message (didn't go to it till after I posted). It seems your newest error would be the last write done so you would have to skip the first one. The thing here also is though I see it actually takes up more than one line, so you'd have to skip multiple lines.
If you dont know how to read in and rewrite a file then post and I'll go into it tommorrow but about to go to bed so not going into it right now.




Reply With Quote