Error Logging Framework in Salesforce
In Salesforce, to check for the errors, we do use debug logs. But the issue arises because we don't have access to logs when there is error in production. Many of the errors are even hard to replicate in production. Also the standard debug log hits the storage limit in production. Also if we delete some logs, it might delete those logs which would have been important to others. So here we are going to see a way to store the errors in SFDC so that users at any point of time in future can see and work upon them, without facing any of the issues mentioned above. So to start with we will create a custom object named : Log__c Then we will create the following custom fields of this object : 1. Log_Number__c : Auto Number 2. Exception_Cause__c : Long Text Area 3. Exception_Message__c : Long Text Area 4. Exception_Type__c : Text 5. Line_Number__c : Number 6. Stack_Trace__c : Long Text Area 7. Execution_Context__c : Text Then create custom Metadata i