5

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?

Thanks

1

1 Answer 1

6

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?

4
  • Thanks jordan .. Will take a look at FuseIT.. Developer console seems to freeze up many a times for me
    – Prady
    Sep 5, 2012 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, 2012 at 12:58
  • FireFox on windows
    – Prady
    Sep 5, 2012 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, 2015 at 19:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .