function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
aalazzaniaalazzani 

Apex Data Loader Error Email Notifications

I want to create a CLI configuration of Data Loader. Everything works fine except that we want to handle errors in two different ways.

1- For operational errors such as login error, network errors, proxy errors, we want an email notification to be sent to the System Admin.
2- For Data Errors, such as Insert or Update errors, we want to send an email to the record owner. Also we have some acceptable error for which we don't need to send emails, so we want to exclude them from the notification.
So here are my questions,

1- I changed the log-conf.xml file to include SMTP Appender but the problem is that both types of errors above have the same log4j level "ERROR" so I cannot distinguish between the two to create different SMTP Appender for each. How can I achieve that using log4j configuration.
2- Is it possible in After Insert, After Update triggers to access the transaction results? I am thinking of creating a trigger that check these errors, process them and notify owner with them.
3- Is there any better way to do that? I will appreciate any suggestions.

Thanks in advance.
Aref