Skip to main content

Viewing DEBUG statements in Salesforce APEX Files using the Browser Developer's Console




How to view System Debug Statements in the Salesforce Dev Console





Use system debug statements in your Apex code to log the info you need.

 system.debug('results ' + results);   


Open up the page and execute the behavior you are trying to monitor using system debug statements.

Choose the Logs tab at the bottom of the console and double-click the most recent log for the page you are monitoring.

i.e. apex/yourpage


Select Apex log file
Select the Logs tab and open your log file

Once the log is open you can either check the "DEBUG ONLY" checkbox or check the "Filter" checkbox and filter on the string "USER_DEBUG" or any custom string you are searching for specifically.  Both options are at the bottom of the console.



Filter for USER_DEBUG events
Set the Filter to only display items containing "USER_DEBUG"

Viewing logs in the browser in your Salesforce Instance


If you are having trouble opening the logs in the Developer Console you can open the logs in a regular browser window.

Go to your Salesforce instance and click "Setup" in the top right corner

Then on the left hand menu, at the bottom click on debug logs:

View logs in a browser on your Salesforce instance
View logs in your Salesforce Instance

Then select the appropiate log, click view or download and you can manually search for DEBUG statements using the find command(ctrl+f).


Software Development Blogs - BlogCatalog Blog Directory

Popular posts from this blog

Change Port on a Spring Boot Application when using intelliJ

Change Port on a Spring Boot Application when using intelliJ  Two ways to change the port that the embedded Tomcat is using in a Spring Boot Application. The first way is to modify the application properties in the resources folder: Update application props in Spring Boot Application There are a couple issues with this approach.  You might only want this port change in your local environment and if you check it in by accident you might break things. Alternatively, you can use a command line parameter. Go to Run -> Edit Configurations -> VM options Then enter in the following argument: -Dserver.port=8090 Then click apply and OK and attempt to run the application again. Update port using VM option

How to set up a SQL Server 2008 Local Database

Setting up and Configuring your Microsoft SQL Server 2008 Local Database Download SQL Server Download SQL Server Express.  Express is the Free edition of MS SQL Server http://www.microsoft.com/en-us/download/details.aspx?id=1695 Install your SQL Server Instance Click the Start button -> Click Microsoft SQL Server 2008 -> Click Configuration Tools -> Select SQL Server Installation Center Select Installation -> Select New SQL Server stand-alone installation Select SQL Server stand-alone installation Get your Local SQL Server Service Up and Running Open up the SQL Server Configuration Manager Click the Start button -> Click Microsoft SQL Server 2008 -> Click Configuration Tools -> Select SQL Server Configuration Manager Setup SQL Server Config Manager Start up the SQL Services You want to ensure the following services are in the "Running" State and then you want to set the following services to automatic St...

Building Microservices with JHipster

Check out this article on Medium and LinkedIn Pulse, for a brief overview of microservices as a primer for working with JHipster to build web applications with a Microservices backend. Building microservices with Jhipster JHipster is sponsored by Ippon Technologies(https://www.ippon.tech/). Need cost-effective fractional engineering with US expertise? Fintech and Blockchain Specialized Fractional Engineering