I am scheduling a class which performs some computations I want to know how to track the execution of class apart from viewing scheduled jobs as I have scheduled the class to execute at system time but I cannot see it changing next scheduled run or publishing any logs after the time.

  • how you want to track this?? – Avijit Das May 2 '17 at 10:53

The easiest way to save logging information about code in production is to create a separate custom object to store it, and saving new instances of that custom object when the code runs (or when it errors out, which is the more common use case). In your case, you can specialize this to have fields matching the actual steps of the calculation you want to track, or simply have a large text field to store a log trace.

You can use debug logs to track scheduled classes, but you have to go to the Apex Logs section and explicitly track the logs for the user who owns the scheduled job. This has a time limit though, so you have to actively be looking to track the logs, whereas the solution above can be done passively by the class and will be available if you have a sudden need to check the last log.

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.