Perhaps you can adapt this
In[1]:= stream = OpenWrite["Log.txt"];
Write[stream, "Logging"]; (*Make the file exist so we can append later*)
Close[stream];
Reap[
For[i = 1, i <= 3, i++,
Sow[i];
stream = OpenAppend["Log.txt"];
Write[stream, i];
Close[stream]
]
][[2, 1]]
Out[4]= {1, 2, 3}
and the Log.txt file will appear in the default location, unless you want to specify the path to where you want to put that.
The OpenAppend and Write and Close should safely ensure the data is isolated from other calculations going on, until you repeat that.