Am running a script that checks every line in a foreach loop. I would like help in how to tackle this each execution needs to be written to a log file which will show how log it went to process the each line at a time and if there is an error it will break the loop and display the log file.
I was thinking of a try catch or is there a class I can try thanks