Bad CRC on boot

Hi,

Is there a way we can create a log on SD card, when there is a bad CRC detected on boot cycle? If not, can someone guide me implementing this.