I have been working on test classes and often writing test scenarios for code developed by other developers. Many a time i would need to insert in some debug statements to understand the flow of the code or to identify what is causing the failures of asserts.

I currently run the test class using the Apex Test Execution under Develop and check the debug logs under Administration setup -> monitoring.

I find this method a lot time consuming with the no of clicks needed to get to the logs. Is there a better way of doing it?



There are ways to export the debug logs to remote programs like the one posted in the comment above.

However, you should use the developer console rather than the 'Setup->Monitoring' for faster execution of individual methods and debugging test methods when they're actually running.

Also, for more technical examples see: How to export debug logs?

  • Thanks jordan .. Will take a look at FuseIT.. Developer console seems to freeze up many a times for me
    – Prady
    Sep 5 '12 at 7:22
  • 1
    Which browser are you using? It seems to be more reliable in some that others. The Heap Dumps are by far the best way of debugging apex code these days.
    – Matt Lacey
    Sep 5 '12 at 12:58
  • FireFox on windows
    – Prady
    Sep 5 '12 at 13:29
  • I use a simple tool which streams logs to browser window, Extremely productive and customizable. All you need is add a logger class in your salesforce environment and call Restlogger.debug('logname', JSON.serialize(data')); And subscribe for logs using Salesforce login Username.. Bammm that's all github.com/gs-akhan/salesforce-debugger
    – Kiba
    Jun 1 '15 at 19:16

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.