Sometimes it is necessary when troubleshooting Salesforce automations or trying to find out why things are functioning differently than normal such as cases getting auto closed to run debug logs. Debug logs allow you to see exactly what is happening when Salesforce is executing your business logic. This guide will help you capture a debug log to analyze.
Turn on Debug Logs
Recreate the issue
Reading the Debug Log
Reading the Debug Log can be the key to figuring out what is happening, but can also be hard to understand when there are a lot of things in them. Below is a list of some of the common things to keep an eye out for and how to interpret them if you come across them.
ENTERING_MANAGED_PKG: This means the code is executing logic from a managed package from the Appexchange. There is no way to see exactly what is happening because that code is protected.
LIMIT_USAGE_FOR_NS: This will generally be followed by the limits that the transaction is currently at for the particular name space. This can be helpful to see if there are issues with hitting governor limits.
SOQL_EXECUTE_BEGIN: This is going to be when a SOQL query is executed by the code. This can show what the exact query is to see if it is not formed correctly.
SOQL_EXECUTE_END: This can be found generally after a SOQL Execute Begin and it will show the number of rows returned from the SOQL query. If the number of rows is 0 that means no records were found
FLOW_CREATE_INTERVIEW_BEGIN: This will be used at the start of a flow and can help to identify the start of the flow interaction.
FLOW_INTERVIEW_FINISHED_LIMIT_USAGE: When troubleshooting governor limits related to record-triggered flows, looking for this event can be informative to see what the limits were at the end of a flow transaction.
FATAL_ERROR: This can be caused by numerous things, but seeing it can generally indicate that something preceding it in the debug log caused the error.
DML_BEGIN: This means that some type of insert or update records is taking place. There will be an identifier that will specify the DML operation being performed.
There are many other events that you will see in the debug logs. A full list of them can be found here: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_system_log_console.htm
000392579

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.