Use an automation app like Automate, Macrodroid, Tasker.
I have a few scripts that respond to geolocations, but it wouldn’t be hard to add some other features.
Currently these scripts save output to a text file (CSV) that is synced to my file server using Syncthing.
You could use various triggering mechanisms, such as BT connect in the car, or an NFC tag, disconnecting, from wifi (that’s a good indicator you’re traveling), etc.
There’s also a location tracking app you can self host, let me find a link.