Apex Debug logs or Apex Replay Debugger, both generates Logs. Which is the best to choose.
-
1Welcome to SFSE! Please take the tour and read How to Ask. This seems like a very opinion-based question to me (which doesn't work well with the overall stackexchange format). They both have their place. One correction to make is that the apex replay debugger does not create logs itself. Rather, it uses a previously generated debug log to allow you to step through the execution of Apex and inspect the contents of variables.– Derek FCommented Aug 16, 2020 at 12:24
1 Answer
The debug log is data, while the Apex Replay Debugger is an executable. As such, you can't compare the two, much like you can't say "What's better: Microsoft Word or a Microsoft Word document?" Just like you can open a Microsoft Word document in other programs, like Open Office, you can open Apex Debug Logs in other programs, such as the Developer Console or Microsoft Log Viewer. In contrast, you cannot open the Apex Replay Debugger in another program as you would a document, because it's an executable, not "data."
The Apex Replay Debugger is a powerful tool that allows you to see exactly what line of code you're on, the state of memory, and so on, just as you would with a live debug session, but without pausing a live server thread. This is very similar to the Developer Console's Debug Log Viewer, except coupled with an IDE so that you can easily step through, set "breakpoints", and all other kinds of nifty debug tricks on a transaction, all without having to pause and/or run the same code on the server over and over again.
Other tools are out there, such as Salesforce's Check Points, which are integrated with the Developer Console, or you can use more generic log viewers, like Microsoft Log viewer. Each tool has its own advantages and disadvantages. The Apex Replay Debugger seems to be finicky to get working correctly, but when it does, it provides a very easy-to-use, intuitive interface that any Java or C++, JavaScript, etc developer feels at home with. It's one of the best options out there for debugging Apex (it's certainly salesforce.com's best version of offline/postmortem debugging to date).