In recent years, autonomous vehicles (AVs) have become increasingly more robust through the use of advanced technologies and accurate AI/ML models. However, incidents of crash and other untoward events involving AVs still get reported from time to time. In such situations, it is imperative that the cause be established whether there was a problem with the sensors, actuators, model parameters or any other factor impacting the driving decision of the AV that resulted in the crash. This requires multiple parties like the automaker, sensor manufacturers, model developers and actuator suppliers to access the data logged by the AV during driving till the time of the incident. Although collaborating entities, they do not necessarily trust each other, especially in sensitive situations like investigating a crash. To overcome this shortcoming, we propose a novel blockchain based method called AVChain for verifiable logging of data for each AV that can be selectively shared with the relevant parties under appropriate access control mechanisms. Scalability is achieved through the use of InterPlanetary File System (IPFS) for storing the actual data while its hash is maintained in an enterprise blockchain like HyperLedger Fabric (HLF). We show the effectiveness and versatility of AVChain by generating data from CARLA - a widely used simulator for AVs, and invoking appropriate HLF chaincodes developed for this purpose. A browser based interface has also been designed to demonstrate the working of the complete infrastructure.