You might use another language e.g. python. For the script below you need to install python and the serial lib pySerial (IIRC). This small script is used to fetch lines from a serial port. These lines are split into fields (; = separator); and the complete line is send to a logfile.
Trick used here is to send integers as ASCII from the Arduino -- Serial.print(x, DEC); -- A few more bytes may be used for communication but on the other hand all is readable. The Python serial class has a function readline() that hides all the difficult work. Recently I tinkered with gobetwino, took me a few hours to do what I wanted but also a powerful tool.
import sys, os, serial, datetime
def capture():
print "Start capture"
ser = serial.Serial(4, 115200, timeout=0)
while (1):
line = ser.readline()
if (line != ""):
#print line[:-1] # strip \n
fields = line[:-1].split('; ');
ID = fields[0]
TIME = int(fields[1])
TIN = float(fields[2])
TOUT = float(fields[3])
# write to file
filename = str(datetime.date.today()) + ".log"
text_file = open(filename, "a")
text_file.write(line)
text_file.close()
""" -------------------------------------------
MAIN APPLICATION
"""
print "Start Application"
print
capture()