in reply to Add a line to the end of a file

Does the above code actually load the file into memory?
Only if your OS requires to do so, but I don't know any OS that requires it.
Is there a more efficient way to add the data to the logfile then what I'm using?
It depends on how often this code is run. If you log a lot of lines this way, opening and closing the file for each piece of data being logged, it's inefficient. It would be better to open the file once, and close if the program terminates.

Abigail