Using the Developer Console

The Force.com Developer Console is a separate window that displays debugging information, cumulative resources used versus system limits, and source code executed. It can be considered a context-sensitive execution viewer, showing the source of an operation, what triggered that operation, and what occurred afterward. Use the Developer Console to view debug logs that include database events, Apex processing, workflow, and validation logic. Access the Developer Console by clicking Your Name | System Log in the upper right corner of any page.

The Developer Console System Log
The System Log console

To learn about the different sections of the Developer Console System Log, see “The System Log View” in the Salesforce online help.

To learn more about some typical ways you might use the Developer Console, for example, tracking DML in your transaction or monitoring performance, see “Examples of Using the Developer Console” in the Salesforce online help.

When using the Developer Console or monitoring a debug log, you can specify the level of information that gets included in the log.
Log category
The type of information logged, such as information from Apex or workflow rules.
Log level
The amount of information logged.
Event type
The combination of log category and log level that specify which events get logged. Each event can log additional information, such as the line and character number where the event started, fields associated with the event, duration of the event in milliseconds, and so on.
Note
Visualforce isn't available in Database.com.

Debug Log Categories

You can specify the following log categories. The amount of information logged for each category depends on the log level:

Log Category Description
Database Includes information about database activity, including every data manipulation language (DML) statement or inline SOQL or SOSL query.
Workflow Includes information for workflow rules, such as the rule name, the actions taken, and so on.
Validation Includes information about validation rules, such as the name of the rule, whether the rule evaluated true or false, and so on.
Callout Includes the request-response XML that the server is sending and receiving from an external Web service. This is useful when debugging issues related to using Force.com Web services API calls.
Apex Code Includes information about Apex code and can include information such as log messages generated by DML statements, inline SOQL or SOSL queries, the start and completion of any triggers, and the start and completion of any test method, and so on.
Apex Profiling Includes cumulative profiling information, such as the limits for your namespace, the number of emails sent, and so on.
Visualforce Includes information about Visualforce events including serialization and deserialization of the view state or the evaluation of a formula field in a Visualforce page.
System Includes information about calls to all system methods such as the System.debug method.
Note
Visualforce isn't available in Database.com.

Debug Log Levels

You can specify the following log levels. The levels are listed from lowest to highest. Specific events are logged based on the combination of category and levels. Most events start being logged at the INFO level. The level is cumulative, that is, if you select FINE, the log will also include all events logged at DEBUG, INFO, WARN and ERROR levels.
Note
Not all levels are available for all categories: only the levels that correspond to one or more events.
  • ERROR
  • WARN
  • INFO
  • DEBUG
  • FINE
  • FINER
  • FINEST

Debug Event Types

The following is an example of what is written to the debug log. The event is USER_DEBUG. The format is timestamp | event identifier:
  • timestamp: consists of the time when the event occurred and a value between parentheses. The time is in the user's time zone and in the format HH:mm:ss.SSS. The value represents the time elapsed in nanoseconds since the start of the request. The elapsed time value is excluded from logs reviewed in the Developer Console.
  • event identifier: consists of the specific event that triggered the debug log being written to, such as SAVEPOINT_RESET or VALIDATION_RULE, and any additional information logged with that event, such as the method name or the line and character number where the code was executed.
The following is an example of a debug log line.
Debug Log Line Example
Debug Log Line Example
In this example, the event identifier is made up of the following:
  • Event name:
    USER_DEBUG
  • Line number of the event in the code:
    [2]
  • Logging level the System.Debug method was set to:
    DEBUG
  • User-supplied string for the System.Debug method:
    Hello world!
The following example of a log line is triggered by this code snippet.
Debug Log Line Code Snippet
Debug Log Line Code Snippet
The following log line is recorded when the test reaches line 5 in the code:
15:51:01.071 (55856000)|DML_BEGIN|[5]|Op:Insert|Type:Invoice_Statement__c|Rows:1
In this example, the event identifier is made up of the following:
  • Event name:
    DML_BEGIN
  • Line number of the event in the code:
    [5]
  • DML operation type—Insert:
    Op:Insert
  • Object name:
    Type:Invoice_Statement__c
  • Number of rows passed into the DML operation:
    Rows:1

The following table lists the event types that are logged, what fields or other information get logged with each event, as well as what combination of log level and category cause an event to be logged.

Event Name Fields or Information Logged With Event Category Logged Level Logged
BULK_HEAP_ALLOCATE Number of bytes allocated Apex Code FINEST
CALLOUT_REQUEST Line number, request headers Callout INFO and above
CALLOUT_RESPONSE Line number, response body Callout INFO and above
CODE_UNIT_FINISHED None Apex Code ERROR and above
CODE_UNIT_STARTED Line number, code unit name, such as MyTrigger on Invoice_Statement__c trigger event BeforeInsert for [new] Apex Code ERROR and above
CONSTRUCTOR_ENTRY Line number, Apex class ID, the sring <init>() with the types of parameters, if any, between the parentheses Apex Code DEBUG and above
CONSTRUCTOR_EXIT Line number, the string <init>() with the types of parameters, if any, between the parentheses Apex Code DEBUG and above
CUMULATIVE_LIMIT_USAGE None Apex Profiling INFO and above
CUMULATIVE_LIMIT_USAGE_END None Apex Profiling INFO and above
CUMULATIVE_PROFILING None Apex Profiling FINE and above
CUMULATIVE_PROFILING_BEGIN None Apex Profiling FINE and above
CUMULATIVE_PROFILING_END None Apex Profiling FINE and above
DML_BEGIN Line number, operation (such as Insert, Update, and so on), record name or type, number of rows passed into DML operation Apex Code INFO and above
DML_END Line number Apex Code INFO and above
EMAIL_QUEUE Line number Apex Code INFO and above
EXCEPTION_THROWN Line number, exception type, message Apex Code INFO and above
EXECUTION_FINISHED None Apex Code ERROR and above
EXECUTION_STARTED None Apex Code ERROR and above
FATAL_ERROR Exception type, message, stack trace Apex Code ERROR and above
HEAP_ALLOCATE Line number, number of bytes Apex Code FINER and above
HEAP_DEALLOCATE Line number, number of bytes deallocated Apex Code FINER and above
IDEAS_QUERY_EXECUTE Line number DB FINEST
LIMIT_USAGE_FOR_NS Namespace, following limits:
Number of SOQL queries

Number of query rows

Number of SOSL queries

Number of DML statements

Number of DML rows

Number of script statements

Maximum heap size

Number of callouts

Number of Email Invocations

Number of fields describes

Number of record type describes

Number of child relationships

 describes

Number of picklist describes

Number of future calls

Number of find similar calls

Number of System.runAs() 

invocations
Apex Profiling FINEST
METHOD_ENTRY Line number, the Force.com ID of the class, method signature Apex Code DEBUG and above
METHOD_EXIT Line number, the Force.com ID of the class, method signature.

For constructors, the following information is logged: Line number, class name.

Apex Code DEBUG and above
POP_TRACE_FLAGS Line number, the Force.com ID of the class or trigger that has its log filters set and that is going into scope, the name of this class or trigger, the log filter settings that are now in effect after leaving this scope System INFO and above
PUSH_TRACE_FLAGS Line number, the Force.com ID of the class or trigger that has its log filters set and that is going out of scope, the name of this class or trigger, the log filter settings that are now in effect after entering this scope System INFO and above
QUERY_MORE_ITERATIONS Line number, number of queryMore iterations DB INFO and above
SAVEPOINT_ROLLBACK Line number, Savepoint name DB INFO and above
SAVEPOINT_SET Line number, Savepoint name DB INFO and above
SLA_END Number of cases, load time, processing time, number of case milestones to insert/update/delete, new trigger Workflow INFO and above
SLA_EVAL_MILESTONE Milestone ID Workflow INFO and above
SLA_NULL_START_DATE None Workflow INFO and above
SLA_PROCESS_CASE Case ID Workflow INFO and above
SOQL_EXECUTE_BEGIN Line number, number of aggregations, query source DB INFO and above
SOQL_EXECUTE_END Line number, number of rows, duration in milliseconds DB INFO and above
SOSL_EXECUTE_BEGIN Line number, query source DB INFO and above
SOSL_EXECUTE_END Line number, number of rows, duration in milliseconds DB INFO and above
STACK_FRAME_VARIABLE_LIST Frame number, variable list of the form: Variable number | Value. For example:
var1:50

var2:'Hello World'
Apex Profiling FINE and above
STATEMENT_EXECUTE Line number Apex Code FINER and above
STATIC_VARIABLE_LIST Variable list of the form: Variable number | Value. For example:
var1:50

var2:'Hello World'
Apex Profiling FINE and above
SYSTEM_CONSTRUCTOR_ENTRY Line number, the string <init>() with the types of parameters, if any, between the parentheses System DEBUG
SYSTEM_CONSTRUCTOR_EXIT Line number, the string <init>() with the types of parameters, if any, between the parentheses System DEBUG
SYSTEM_METHOD_ENTRY Line number, method signature System DEBUG
SYSTEM_METHOD_EXIT Line number, method signature System DEBUG
SYSTEM_MODE_ENTER Mode name System INFO and above
SYSTEM_MODE_EXIT Mode name System INFO and above
TESTING_LIMITS None Apex Profiling INFO and above
TOTAL_EMAIL_RECIPIENTS_QUEUED Number of emails sent Apex Profiling FINE and above
USER_DEBUG Line number, logging level, user-supplied string Apex Code

DEBUG and above by default

Note
If the user sets the log level for the System.Debug method, the event is logged at that level instead.
VALIDATION_ERROR Error message Validation INFO and above
VALIDATION_FAIL None Validation INFO and above
VALIDATION_FORMULA Formula source, values Validation INFO and above
VALIDATION_PASS None Validation INFO and above
VALIDATION_RULE Rule name Validation INFO and above
VARIABLE_ASSIGNMENT Line number, variable name, a string representation of the variable's value, the variable's address Apex Code FINEST
VARIABLE_SCOPE_BEGIN Line number, variable name, type, a value that indicates if the variable can be referenced, a value that indicates if the variable is static Apex Code FINEST
VARIABLE_SCOPE_END None Apex Code FINEST
VF_APEX_CALL Element name, method name, return type Apex Code INFO and above
VF_DESERIALIZE_VIEWSTATE_BEGIN View state ID Visualforce INFO and above
VF_DESERIALIZE_VIEWSTATE_END None Visualforce INFO and above
VF_EVALUATE_FORMULA_BEGIN View state ID, formula Visualforce FINER and above
VF_EVALUATE_FORMULA_END None Visualforce FINER and above
VF_PAGE_MESSAGE Message text Apex Code INFO and above
VF_SERIALIZE_VIEWSTATE_BEGIN View state ID Visualforce INFO and above
VF_SERIALIZE_VIEWSTATE_END None Visualforce INFO and above
WF_ACTION Action description Workflow INFO and above
WF_ACTION_TASK Task subject, action ID, rule, owner, due date Workflow INFO and above
WF_ACTIONS_END Summer of actions performed Workflow INFO and above
WF_APPROVAL Transition type, EntityName: NameField Id, process node name Workflow INFO and above
WF_APPROVAL_REMOVE EntityName: NameField Id Workflow INFO and above
WF_APPROVAL_SUBMIT EntityName: NameField Id Workflow INFO and above
WF_ASSIGN Owner, assignee template ID Workflow INFO and above
WF_CRITERIA_BEGIN EntityName: NameField Id, rule name, rule ID, trigger type (if rule respects trigger types) Workflow INFO and above
WF_CRITERIA_END Boolean value indicating success (true or false) Workflow INFO and above
WF_EMAIL_ALERT Action ID, rule Workflow INFO and above
WF_EMAIL_SENT Email template ID, recipients, CC emails Workflow INFO and above
WF_ENQUEUE_ACTIONS Summary of actions enqueued Workflow INFO and above
WF_ESCALATION_ACTION Case ID, business hours Workflow INFO and above
WF_ESCALATION_RULE None Workflow INFO and above
WF_EVAL_ENTRY_CRITERIA Process name, email template ID, Boolean value indicating result (true or false) Workflow INFO and above
WF_FIELD_UPDATE EntityName: NameField Id, object or field name Workflow INFO and above
WF_FORMULA Formula source, values Workflow INFO and above
WF_HARD_REJECT None Workflow INFO and above
WF_NEXT_APPROVER Owner, next owner type, field Workflow INFO and above
WF_NO_PROCESS_FOUND None Workflow INFO and above
WF_OUTBOUND_MSG EntityName: NameField Id, action ID, rule Workflow INFO and above
WF_PROCESS_NODE Process name Workflow INFO and above
WF_REASSIGN_RECORD EntityName: NameField Id, owner Workflow INFO and above
WF_RESPONSE_NOTIFY Notifier name, notifier email, notifier template ID Workflow INFO and above
WF_RULE_ENTRY_ORDER Integer, indicating order Workflow INFO and above
WF_RULE_EVAL_BEGIN Rule type Workflow INFO and above
WF_RULE_EVAL_END None Workflow INFO and above
WF_RULE_EVAL_VALUE Value Workflow INFO and above
WF_RULE_FILTER Filter criteria Workflow INFO and above
WF_RULE_INVOCATION EntityName: NameField Id Workflow INFO and above
WF_RULE_NOT_EVALUATED None Workflow INFO and above
WF_SOFT_REJECT Process name Workflow INFO and above
WF_SPOOL_ACTION_BEGIN Node type Workflow INFO and above
WF_TIME_TRIGGER EntityName: NameField Id, time action, time action container, evaluation Datetime Workflow INFO and above
WF_TIME_TRIGGERS_BEGIN None Workflow INFO and above
© Copyright 2000–2011 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.