Improved the logging of the failed records