I haven't used it in flight, but Motion X GPS has worked well for me for 35000kms of driving over 6 months recording on the iPhone.
I'm sure there are plenty of other apps.
Remember by its very function, GPS is less accurate in altitude.
Basically you want anything that records and easily exports (via email) a .gpx file. You can then open this in google earth.