This sort of device will do what you want simply and cheaply:
FlyWithCE Flight Recorder FR300 89 Euros.
It is starting to be used in gliders and is recognised by the BGA as a position recorder.
Price includes analysis software to show the route taken on a map and a barogram.
£93 inc shipping from
LX avionics Ltd - IGC approved flight recorders (loggers)
flyWithCE - Flight Recorder
I have no connection / interest with either maker or UK distributor.