Bulk delete Debug logs from your organization

Have you ever had issue where your developer console is full of debug logs, and you are unable to view new ones?

There is a way how to delete them in bulk.

sfdx force:data:soql:query -t -q "SELECT Id FROM ApexLog" -r "csv" > out.csv -u DEVORG

sfdx force:data:bulk:delete -s ApexLog -f out.csv -u DEVORG

The first line will export logs from DB, and the second one will schedule the bulk job for deletion.
This way you will delete all the debug logs from the ORG and do the cleanup.

One Reply to “Bulk delete Debug logs from your organization”

Leave a Reply

Your email address will not be published. Required fields are marked *