How to get failure records in a run time during batch process

I have small requirement , have pipeline which will copy the data from cloud through batches ,during batch processing some of records are faulty records those needs to be captured and re-processing again . How can I provide log the faulty records and provide those to the customer .
My present process is log all faulty records through error route view .there is any other way to capture those records during the run time ,please let me know