Recently I have regularly been getting the error message below when opening the Developer Console:

The Developer Console didn't set the DEVELOPER_LOG trace flag on your user. Having an active trace flag triggers debug logging. You have 316 MB of the maximum 250 MB of debug logs. Before you can edit trace flags, delete some debug logs.

It happens in sandbox and scratch orgs. Haven't tried in production.

This only started happening recently. It goes away after clearing the logs but comes back after a few test runs.

Also: the Debug->Clear->Log Panel action is not working for me -- the logs stay put. I can remove them using the Query Editor as described here, but it's pretty tedious.

Two questions:

  • Does anyone know a way to prevent the logs from exceeding the max level? Perhaps by having old logs cleared out automatically?
  • Is there a known issue with the Clear Log Panel action? I am using Chrome btw.


  • The Clear -> Log Panel has not worked for me either for at least 1-2 years....
    – Eric
    Commented Jun 24, 2018 at 5:21

2 Answers 2


The short term solution is to keep playing whack-a-mole~ApexLog as Adrian has suggested.

Longer term, the problem comes back to the Summer'18 update Store Larger Debug Logs with Changed Log Limits:

We increased the size limit for debug logs from 2 MB per log to 5 MB. You can store up to 250 MB of debug logs at a time. System logs are now deleted automatically after 24 hours instead of after seven days. Monitoring logs are still saved for seven days.

This is also compounded with the Winter '18 update Retain More Debug Logs for Longer:

We changed the way that we delete old debug logs. We now retain debug logs for 7 days. You can generate a total of 250 MB of debug logs in a 15-minute window. When your org is upgraded to Winter ’18, all logs that are at least 7 days old are deleted. This change applies to both Lightning Experience and Salesforce Classic.

Previously, you could generate up to 50 MB of debug logs. We kept them indefinitely, deleting the oldest log each time that you exceeded the limit. We removed the 50 MB limit and changed to a 7-day storage limit.

A couple of releases ago you had Apex logs up to 2 MB in size with a total limit of 50 MB that would automatically drop the older logs.

Currently (Winter '18) you have logs up to 5 MB in size with a total limit of 250 MB that can stay around for up to 7 days before being automatically purged. As many are finding, in a busy org it is easy to hit that 250 MB limit in a much shorter time period than 7 days.

I've created the idea Allow TraceFlags to indicate that Debug logs can be deleted automatically. The idea is to give the developer/admin control how how long they need the corresponding logs to stay around for. With a TTL (Time to Live) setting on each generated log they could be cleared out automatically while still giving the flexibility to capture a few large short term logs or smaller logs with a longer life span.

Nathan Totten is the current PM for this area an is aware of the issues it is causing - https://twitter.com/ntotten/status/1007432141725224960


I believe I saw the fix to this on SFSE, but can't seem to find it now. When having this issue, run this query in your Query Editor:


Then simply delete all rows.

  • I think this was the fix you were thinking of. It mentions doing the delete against the Tooling API. Commented Jul 9, 2018 at 20:52
  • @DanielBallinger Indeed. We should probably close this question as a duplicate.
    – Adrian Larson
    Commented Jul 9, 2018 at 22:34
  • 1
    Is there a nice way to move my answer from here to that question? I guess I could just re-post it there. This Q is slightly different in that it isn't just "How to fix it", but whey is it occurring in the first place and how can it be prevented in the future. Commented Jul 9, 2018 at 22:44
  • Yeah I'd just copy your answer over.
    – Adrian Larson
    Commented Jul 9, 2018 at 23:15
  • 1
    Is there a programmatic way to delete these logs? I have to go to the UI, click delete and watch google chrome freeze for minutes.
    – abhi
    Commented Jul 12, 2018 at 19:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .