Delete all in Debug log

SELECt ID from APEXLOG and run this query in DC Query Editior and select the tooling API checkbox. Now Delete all the records. It will solve your problem and this is a native solution.


Now that we have SFDX, I use the below method to delete debug logs from terminal:

$ sfdx force:data:soql:query -q "SELECT Id FROM ApexLog" -r "csv" > out.csv
$ sfdx force:data:bulk:delete -s ApexLog -f out.csv

I had an org with over 400mb of logs that needed to be cleared! The Salesforce developer tools only lets you delete 2000 rows at a time and the process has to be manually repeated.

So instead I opened up Salesforce classic debug log page and run the following JavaScript from Chrome Developer Tools - it will keep bashing the Delete All button for you.

setInterval(
    function() {
       if (document.querySelector('span[id*="deleteAllStatus.start"]').style.display === 'none') {document.querySelector('input[value="Delete All"]').click()}
    }
    ,250);

Tags:

Debug