Our Blog

What is Debug Log in salesforce

What is 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 Debug log by adding them to list of Monitored Users.

 

Debug Log Details

debug log detail fromat

A 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 debug log entry
  1. Method name
  2. The line number where the code was executed
  3. log data

The following information is monitored by  Debug 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

 

 

Debug Log Levels

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

  • NONE
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • FINE
  • FINER
  • FINEST

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

 

Limits

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 debug logs. The oldest logs are overwritten.

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

 

How to delete debug Log?

When salesforce org too many debug 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.

 

 

Leave a Comment

Comments (0)

Please verify that you are not a robot.

css.php