A logging tool system for analyzing the carbon dioxide concentration in a fluid sample downhole in a borehole. A chamber is filled with the fluid sample and is closed to isolate the fluid sample from the borehole. The interior chamber volume is expanded to decompress the fluid sample, and a transmitter discharges light in the mid-infrared range. A sensor measures the absorbance of mid-infrared light by the decompressed fluid sample and generates a signal representing the carbon dioxide concentration. Mid-infrared light absorbance in the range between 4.1 and 4.4 microns can be analyzed by the processor to identify the carbon dioxide concentration in the fluid sample, and infrared absorbance in the mid-infrared range between 3.2 and 3.6 microns can be analyzed to identify methyl and metheylene components. A wiper cleans the transmitter and sensor between readings to reduce measurement errors caused by fluid sample contamination.