How to Capture Debug Logs
Sometimes it it helpful to capture Salesforce's debug logs. The steps below will show you how to capture these logs.
1. Log into Salesforce.
2. In Salesforce setup, quick search “Debug Logs” and then click “New”.
3. Configure the Trace Flag and choose the Traced entity Type, which would most often be the “User” option.
4. The “Traced Entity Name” should be the LeanData integration user so that we can trace the actions under this user and catch any errors.
- If it’s a batch error that we are attempting to gather further detail on, the traced Entity should be the LeanData integration User.
- If it is a One-Time Routing/DataLoader/Bulk Update Errors, essentially anything outside of the Batch job, the traced entity should be the user that initiated the action.
5. The Start Date and Expiration date should be the window that you would like to capture logs within.
6. Choose the appropriate Debug Level, in most cases this would be the “SFDC Dev Console” level.
Please Note: If there are APEX Timeout issues in the Batch jobs, you can make a new Debug level and call it “LeanData_Debug”, for example.
7. Set the “Apex Code” to the “Debug” option and set the “Apex Profiling” choude to “Finest” to capture a deeper level of detail in the logs. All other category values can remain as the default choices.
8. Once completed, save the debug level and select it:
Once the logs window has completed and the logs are captured, you can download the results for individual operations to get the debug logs.
To find the right debug logs to download, look for the “SerialBatchApexRangeChunkHandler” and click the “View” button.
When you click into the view look for the “ContinuousCleanBatch” on the page, if this is present, this would be the log to send to us for inspection. You can word search this for convenience.