How to track data from sensor with GPS position?

Hi everyone,

Im new to ardupilot and have a school project that works with it. I need to track data from a gas sensor connected to pixhawk via I2C with actual position from GPS. Is there a way to log data from just these two sensors separately from full on telemetry? Can anybody help? Thanks!

just for refrence please have a look.