Fix logging for transaction exceptions.