How to log data to a file from arduino

Are you using the standard Arduino IDE? If not, desist from whatever you are using and install the proper Arduino IDE immediately.
Therein, under Examples, you will find a raft of examples, one of which, in the SD section, is a datalogger writing to (surprise!) the SD card.

Since you don't have an SD facility, you might get some value from trying option 1. I described above.

Here is the code

void loop() {
  delay((1000);
  Serial.print("hello, world!       ");
  Serial.println(millis()/1000);
}

Yes, that's it. Good luck, I'm not in a position to test it at the moment, but sure it will work