Append to log file and print datetime.