Thank you very much @ShaikMaheer-MSFT , this was very helpful. I have been able to solve the issue with logic app since I posted this question. I realized that using this method isn't very efficient because I either have to do a stored procedure activity for every step in the pipeline or do an execute pipeline activity and insert my whole pipeline process in it.
What I did with the logic app was to read the result of my log analytics query for every pipeline error and send the result as an email. I hope this is a better reply for anyone having this same issue.
I'm currently trying to do a parallel action that can also log the data to a table as well. Any help with that?