function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Full debug log in exception email

When I get an email notice of an unhandled apex exception, sometimes it includes a full debug log dump, and sometimes it doesn't.  What determines whether it includes the log or not?


Last night I was struggling with a tricky bug, one I couldn't seem to recreate in my tests, and I was trying to get a log of some code launched from a VF page.  It was sending me exception emails, but the debug log was cut off after one line (total email size 2K).  Hours later, the exact same error resulted in an email with a full log (email size 190K).  I had the System Log window open the second time, hoping to get the log to show up there.  It didn't, but does that affect what you get in the email?  


I made a few other settings changes in between the two emails (turned off Development mode) and was using a different browser, but I wouldn't expect that to make a difference.



I want to know this too.   Better yet, how do I access the current transaction's debug log from a trigger, so that i can email it to myself when the exception is handled.