Clear Users from Debug logs using SOQL in Salesforce

ERROR: sObject type ‘TraceFlag’ is not supported.

Follow below steps in Production/Sandbox/Developer Organization if you see the too many users added in debug logs
Setup -> Administration Setup -> Monitoring -> Debug Logs

1. Go to Developer Console (Your name -> Developer Console)
2. Click on ‘Query Editor’ tab
3. Run this query with ‘Use Tooling API‘ checked and click ‘Execute’: SELECT ID FROM TraceFlagClear-User-from-debug-logs
4. This should return some records. Select all records and click ‘Delete Row’
5. Repeat 3 and 4 until you are left with 1 or 2 records and check back in debug logs. Most of the users must be cleared now


Tooling API –

Written by 

3x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia

Leave a Reply

Your email address will not be published.