- changed status to resolved
Logfile is cleared when restart the app
Issue #316
resolved
I have tried TLogFileAppender and noticed that between app restarts the logfile is cleared and did not notice any property / method that would change this behaviour.
Comments (3)
-
reporter -
repo owner I would suggest using:
System.IOUtils.TFile.Open(path, TFileMode.fmAppend, TFileAccess.faReadWrite, TFileShare.fsReadWrite);
That handles everything perfectly - yours would now fail when the file does not exist yet. And it automatically sets the position to the end.
-
reporter I was catching the problem with FileExist but your suggestion is the best. And I've learn something again. Nice.
- Log in to comment
I must use TStreamLogAppender and set the position of the TFileStream to the size.