Salesforce Interview Questions & Answers Book is now available!

Grab Now

Apex

Delete all debug logs in Salesforce

Delete all debug logs in Salesforce programmatically.

By Teja, ex-Salesforce engineer · Updated January 17, 2021 · 1 min read

At times when you try to run Ape code and access the debug logs you might not be able to find them.

It's because of the governor limit that restricts the platform showing up the debug logs.

In case you want to solve this problem here are the steps you need to take.

  • Log into your Org
  • Open up the Developer Console
  • Click on Query Editor
  • Run this query
SELECT Id, StartTime, LogUserId, LogLength, Location FROM ApexLog
  • It's going to show you all the logs, select all of them using shift and scrolling.
  • Finally click on delete rows.

Learn it by building it

Every course, every code repository, the discussion group and certificates of completion — one subscription.

Keep me in the loop!

Email me when a new episode is published (promise, I will not spam you)

You're signing up to receive emails from Salesforce Casts