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.
- 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 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