Not getting debug logs in version 50+ sandboxes.

Issue #1805 resolved
Justin Julicher created an issue

It seems SF have implemented a change if you now set a debug log setting via the API that has finer granularity than what is available via the UI it will only output user debug messages. AFAIK the System setting will only allow finer granularity via the UI but by default IC sets System debug to Finest.

I’ve attached a log file where the log was set to Full Debugging setting.

The only way I was able to generate a log file with all the System debug info was to reset it via the UI and then run an anonymous apex with the correct setting and then do something via the UI to generate a new log with system & apex info in it.

Hopefully you can reproduce it.

Comments (11)

  1. Scott Wells repo owner

    I had another user encounter something similar the other day and was going to dig into it next week. I'll use this issue to track that work. I'll let you know what I find.

  2. Scott Wells repo owner

    Nothing to report yet. I've spent a non-trivial amount of time recently wrestling down Spring '21 things, and this week I'll be readying the Spring '21 release of IC2 in advance of the upcoming release. I'll slot this in for investigation at the beginning of next week. Sorry for the delay...

  3. Justin Julicher reporter

    Hi Scott

    All good. I'll log a request with Salesforce as this does seem more like a SF issue.

    And I'll let you know how it goes

    Thanks.

    Justin

  4. Justin Julicher reporter

    @Scott Wells

    I think I figured this one out - if the debug logs are full then it only logs minimal information rather than giving an error. Once you delete all the logs then it gives you the full debug output.

    Is there an easy way to monitor the size of the debug logs?

    EDIT: Never mind I started debugging again and then suddenly I was only getting METHOD_ENTRY & METHOD_EXIT logs 😞

    thanks

  5. Scott Wells repo owner

    This sounds like a variation of an issue that was occurring a few years back where it would just stop writing logs altogether and even throw an error (or perhaps write the error into the log instead) when you filled your log allotment. That was a pretty nasty way for them to handle it, and they quickly moved away from it. It does still sound like a Salesforce issue, though, so it's probably worth getting details on the state of your org (log number, total size, etc.) when it's in this state. You should be able to run queries like SELECT SUM(LogLength) FROM ApexLog and SELECT COUNT() FROM ApexLog to get some of that information. You can also add constraints like the log user ID if that's relevant. I think it would be good to characterize the org when this is happening, and then we can ask folks at Salesforce what might be happening.

  6. Justin Julicher reporter

    Thanks Scott - what I have found is that there is too much logging information coming through and it seems to get cut off if it thinks it will be too big.

    I had an Object that has 200 fields that I was prepopulating with random data and causing a huge log to be generated when debugging and it would just cut off very quickly but still give all the method entry & exit info. Soon as I switched that off it would generate the full debug info again. …

    It’s not very opaque how they handle this so it’s a bit of a guessing game.

  7. Scott Wells repo owner

    Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.

  8. Log in to comment