Slaesforce FAQ

how to analyze salesforce debug log

by Brielle Bins III Published 2 years ago Updated 2 years ago
image

Let’s see how to view your Salesforce debug logs:

  • To view the debug logs, from the setup option in Salesforce, enter ‘Debug Logs’ in the ‘Quick Find box’, then select ‘Debug Logs’.
  • Once you select the Debug Logs, click the ‘View’ button to examine the log.
  • Click ‘Download’ to download the logs as an XML file.

To view a debug log, from Setup, enter Debug Logs in the Quick Find box, then select Debug Logs. Then click View next to the debug log that you want to examine.

Full Answer

How to use debug logs in Salesforce to troubleshoot?

  • Processes created in the Process Builder appear as flows and workflow rules in debug logs. ...
  • Record change processes appear as flows of type Workflow. ...
  • Immediate actions that are executed in a block are strung together in the flow. ...
  • Scheduled actions are executed after a FLOW_WAIT element. ...

More items...

How to enable debug logs?

Log on to the computer as a member of the local administrators group. Launch Event Viewer. Select ViewShow Analytic and Debug Logs. Navigate to Event Viewer (Local)Applications and Service LogsMicrosoftUser Experience VirtualizationApp Agent. Right-click on Debug under App Agent and select Enable Log.

What are debug logs and how do I use them?

  • Each debug log must be 20 MB or smaller. ...
  • System debug logs are retained for 24 hours. ...
  • If you generate more than 1,000 MB of debug logs in a 15-minute window, your trace flags are disabled. ...
  • When your org accumulates more than 1,000 MB of debug logs, we prevent users in the org from adding or editing trace flags. ...

How do I collect debug logs?

To collect debug logs

  • Right-click on “Debug” node and select “Save all events as”.
  • Choose a location and a file name and Save.
  • Choose “Display information for these languages” and select “English (United States)”.
  • Click “Ok”.

image

How do I view the debug log in Salesforce developer Console?

Use the Log InspectorFrom Setup, select Your Name > Developer Console to open Developer Console.Select Debug > Change Log Levels.Click the Add/Change link in General Trace Setting for You.Select INFO as the debug level for all columns.Click Done.Click Done.Select Debug > Perspective Manager.More items...

How do you trace DML statements executed in debug logs?

Tracking DML in a Request In the Execution Log panel, select Filter, then type DML . All items in the request that contain DML anywhere in either the event or details display. In the Execution Overview panel, click the Executed Units tab and disable all other types of execution, except for DML.

What information can the log inspector contain?

The Log Inspector is a context-sensitive execution viewer in the Developer Console. It shows the source of an operation, what triggered the operation, and what occurred next. Use this tool to inspect debug logs that include database events, Apex processing, workflow, and validation logic.

What are debug levels in Salesforce?

A debug level is a set of log levels for debug log categories, such as Database , Workflow , and Validation . A trace flag includes a debug level, a start time, an end time, and a log type. The log types are DEVELOPER_LOG , USER_DEBUG , and CLASS_TRACING .

How do I trace Apex code execution Salesforce?

Use checkpoints, logs, and the View State tab to help debug the code you've written.Set Checkpoints in Apex Code. Use Developer Console checkpoints to debug your Apex classes and triggers. ... Overlaying Apex Code and SOQL Statements. ... Checkpoint Inspector. ... Log Inspector. ... Use Custom Perspectives in the Log Inspector. ... Debug Logs.

What is a trace flag in Salesforce?

Trace flags filter the logs generated by the transaction. It contains debug level, start-end time, type of the log (ERROR, WARN, DEBUG), and the status of the job/transactions. Once you set the Trace Flag, the system will generate the debug log when a user performs the transaction.

What is the meaning of debug level?

A debug level is a set of log levels for debug log categories, such as Database , Workflow , and Validation . A trace flag includes a debug level, a start time, an end time, and a log type. The log types are DEVELOPER_LOG , USER_DEBUG , and CLASS_TRACING .

How do I use checkpoints in Salesforce Developer Console?

Set Checkpoints in Apex CodeOpen the Apex class or trigger in the Source Code Editor.Click in the margin to the left of the line number where you want to set the checkpoint. ... Execute the code with the Developer Console open.View your checkpoints and results on the Checkpoints tab.

How do I get developer console perspective?

Creating Custom Perspectives in the Log InspectorIn the Developer Console, open a log in the Log Inspector.Click Debug | View Log Panels and select the panels you want to include in the perspective. For a list of available panels, see Log Panels. ... To save your changes, click Save Perspective.

How do I read a debug log?

Required Editions and User Permissions To view a debug log, from Setup, enter Debug Logs in the Quick Find box, then select Debug Logs. Then click View next to the debug log that you want to examine. Click Download to download the log as an XML file.

What is a difference between system log and debug log?

debug log contains all the debug statements and program execution related to the user for which the debug is granted. System log contains all the system related information, anonymous apex execution.

Which of the following are tracked in the debug logs?

A debug log includes a header, execution units, code units, log lines, and other log data. Which events are logged depends on various factors. These factors include your trace flags, the default logging levels, your API header, user-based system log enablement, and the log levels set by your entry points.

What is Salesforce debug log?

Salesforce is a widely used CRM tool. It provides one integrated platform for sales, marketing, services and commerce. The Salesforce debug logs can help you to keep track of time, the status of transactions, etc. In this blog, you will learn about Salesforce debug logs, how to create it and how to use it to track issues.

How to set up debug log in Salesforce?

To set the Debug Log, click on ‘New’. Select the user, start date and expiration date (future date) to set up Debug Log.

How long are debug logs retained?

System debug logs are retained for 24 hours. Monitoring debug logs are retained for seven days. If you are generating more than 1000 MB of logs files in 15 minutes window, Trace flags will be disabled automatically. You will receive an email with the information so that you can analyze and re-enable it.

What is a log level?

Log Levels are useful to determine the type of information logged when the workflow kicks in. Different log levels will help you to understand the process, status of the job, any internal information about code execution, etc. Below are the log levels listed from the lowest to the highest level.

Debug Logs in Salesforce

Debug logs in Salesforce are the best source of information to uncover what is actually taking place on the platform. These are the best option to track back events that might have happened in the Org. Specifically, if we are doing root cause analysis for a particular problem, we can trace out the root cause from the debug logs.

Use cases of debug logs

Debug logs can be used by the developers for tracing any errors that might have occurred on the application. For example, the application is not stable or it is impacting the performance of the other components, or it might stop responding after a certain user input because exceptions are not defined.

Limitations of the Debug Log

Debug logs are undoubtedly helpful for monitoring the platform, but it has certain limitations as well.

Setting Up the debug logging

Debug logging can be activated for Apex classes & triggers and normal users. For this, trace flags need to be configured along with the debug levels, in the Developer Console. Each trace flag will contain the following:

Debug Log Details

Analyzing the debug log is an art, and might need prior experience as a developer or administrator. However, if you are aware of the components of the debug logs, at least you will be aware, where to look for what. The components of the debug log are mentioned below:

How to see logs in Apex?

You can view your log in two ways. Before execution, enable Open Log in the Enter Apex Code window. The log opens after your code has been executed. After execution, double-click the log that appears in the Logs tab. Let’s try the first method.

What does it mean when your log level is FINEST?

If your log level is FINEST (2), your code can hit log limits and take longer to run. Don’t worry if you don’t see all the levels when you update the log level for a category. Only the levels that add more logging for the category are listed.

What is the best way to find problems with a program?

Logs are one of the best places to identify problems with a system or program. Using the Developer Console, you can look at various debug logs to understand how your code works and to identify any performance issues.

image
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9