6

I have an apex job that is failing with a null pointer exception. The status detail unfortunately cuts the stacktrace just short of where it is actually helpful. Is there anyway to view the full stacktrace? Or a way to pull up a debug log for the entire Apex job?

enter image description here

1
  • the CCC Admin user didn't get an email with the full status? – Phil B May 20 '14 at 14:08
7

Setup a debug log by going to Monitoring->Debug Logs under the name which this job runs (listed under the 'Monitored Users'). Next time when the job runs, you should see a full log with complete stack trace along with any debug statements (listed under the 'Debug Logs'). Note that there is a limit on the size of these logs - typically triggers and other web services do not cross these limits, but scheduled jobs may cross depending upon the volume of the records/data it is processing, in which case, the logs will be truncated right at where the size reaches the limits.

3
  • So I can't set up the logs to monitor only a specific job? I have to set it up to monitor all the user actions? – NSjonas Sep 20 '13 at 20:22
  • You set the monitoring by user name, but the log will appear per execution context. For e.g. if you have a scheduled job run under your name and at the same time you access a VF page that invokes a trigger then you will see two different log entries, each will have logs pertaining to that particular execution. – Tech Matrix Sep 20 '13 at 20:32
  • OK... yea i get it. I guess the problem is that it is happening somewhere in a Batch job. I actually found the bug already but was hoping to find a better solution for future debugging. – NSjonas Sep 20 '13 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.