Our Blog

What is Debug Log in salesforce

What is Debug Log in salesforce

Debug Log in salesforce

A debug log records data base operations, system process, and errors that occur when executing a transaction or while running unit tests. We can monitor specific users in log by adding them to list of Monitored Users.


Debug Log Details:

debug log detail fromat

A salesforce debug log includes a header, execution units, code units, log lines, and other log data


  • Timestamp: Consists of the time when the event occurred and a value between parenthese.
  1. The time is in the user’s time zone in the format HH:mm:ss.SSS.
  2. Nanoseconds since the start of the request
  • Event Identifier: Specifies the event that triggered the log entry
  1. Method name
  2. The line number where the code was executed
  3. log data

The following information is monitored by  Logs:

  • Database changes
  • HTTP callouts
  • Apex errors
  • Resources used by Apex
  • Automated workflow processes, such as:
  1. Workflow rules
  2. Assignment rules
  3. Approval processes
  4. Validation rules



You can also specify one of the following logging levels, The levels are listed from lowest to highest

  • NONE
  • WARN
  • INFO
  • FINE

These levels run from lowest to highest and are cumulative. So if you pick the finest level, you get all messages that are logged as error, warn, info, and so on. There are also several debug log categories, and the amount of information logged depends on the log level



Each debug log must be 20 MB or smaller. If it exceeds this amount, you won’t see everything you need. Additionally, each org can retain up to 1,000 MB of logs. The oldest logs are overwritten.

System debug logs are retained for 24 hours. Monitoring logs are retained for seven days


How to delete debug Log?:

When salesforce org too many  logs, we need to delete some or all of your system logs and monitoring logs to create new log

for deleting log Use the Developer Console’s Query Editor to find and delete the logs using Tooling API.

  1. Open Developer Console.
  2. At the bottom of the console, select the Query Editor tab.
  3. Select Use Tooling API.
  4. Enter this SOQL query:SELECT Id, StartTime, LogUserId, LogLength, Location FROM ApexLog
  5. Click Execute.
  6. Select the logs you want to delete.
  7. Click Delete Row.
  8. To confirm the log deletion, click Yes.

Hire a Salesforce Consultant


Leave a Comment

Comments (0)

Please verify that you are not a robot.

Welcome back

Welcome back! Please enter your details

One or more fields have an error. Please check and try again.

Forgot Password?

Tell us about Your Company

How can we help you with your business?