Debug logs not getting stored when triggered from non-apex context and running into an apex limit
Last updated 2019-02-09 ·Reference W-5810242 ·Reported By 4 users
Debug logs are not getting stored when they are larger than a few MBs, the apex execution runs into an apex limit/exception (e.g. Too many SOQL queries) and the execution was triggered from a non-apex context (e.g. visualforce).
- A non-apex context (e.g. visualforce) execute an apex code.
- Apex code runs into an apex limit/exception (e.g. Too many SOQL queries)
- And debug log size is larger than a few MBs then the debug logs are not available to download.
- Follow below steps:
1. Enable a trace flag using the Debug Logs UI (Setup > Monitor > Logs > Debug Logs).
2a. Directly run the apex code that you want to debug using Tooling API (https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/intro_rest_resource_examples.htm)
2b. Or run the apex code using sfdx cli command: sfdx force:apex:execute --apexcodefile (https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_apex.htm)
2c. Or writing an apex test that runs that code and run it using the Apex Test Execution UI (Setup > Build > Develop > Apex Test Execution)
3. Refreshing the Debug Logs UI should now show a list of the debug logs generated from step 2 and users should be able to view/download them.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.