I have a requirement to capture logs related Account and Opportunity triggers. I have configured 'Traced Entity Type' to 'Apex Trigger' , 'Traced Entity Name' to 'Account Trigger' and 'Debug Level' to 'SFDC Dev Console'. But still I couldn't capture any logs. What is the way to retrieve trigger specific logs ?
1 Answer
To see trigger executions, I set my debug as:
Traced Entity Type: User
Traced Entity Name: My User
Then if you are the one executing the DML operation which fires the trigger you will be able to see each trigger that is executed (As long as your debug level has apex code as info/finest).
-
Thanks for your reply. We have a user that does involve in many integrations. Some of the transactions are giving SOQL 101 errors. We need to capture these logs and troubleshoot the trigger execution. So considering this what is the better strategy to capture the logs ? Commented Apr 5, 2019 at 18:12
-
I would recommend putting in more system.debug() statements into your trigger, i would add them before and after each soql query. Generally when i am getting soql limits i look at my code to ensure im not doing any queries inside of for loops (keep in mind calling other methods which have a query from a trigger for loop is easy to overlook) as well as making sure you are using the proper execution context. (updating the object in before, updating child objects in after context)– Logie CCommented Apr 5, 2019 at 18:16
-