1

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
    worth looking at logging patterns such as in Dan Appleman's Advanced Apex 4th edition book or Andrew Fawcett's Logging with Platform Events – cropredy Apr 6 '19 at 0:56
2

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).

| improve this answer | |
  • 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 ? – Subbarao Muppaneni Apr 5 '19 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 C Apr 5 '19 at 18:16
  • Thank you so much. – Subbarao Muppaneni Apr 5 '19 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.