Newer Version Available
Debug Log Order of Precedence
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.
The order of precedence for debug log levels is:
- Trace flags set in the Developer Console override all other logging logic. The Developer Console sets a trace flag when it loads, and
that trace flag remains in effect until it expires.
- To access your trace flags and their expiration times, open the Developer Console and click .
- To add trace flags for a class or trigger, click Add, select a class or trigger, and then click Add.
- To adjust your log levels, double-click fields.
- If you don’t have active trace flags, synchronous and asynchronous Apex tests execute with the default logging
levels. Default logging levels are:
- DB
- INFO
- APEX_CODE
- DEBUG
- APEX_PROFILING
- INFO
- WORKFLOW
- INFO
- VALIDATION
- INFO
- CALLOUT
- INFO
- VISUALFORCE
- INFO
- SYSTEM
- DEBUG
- If no relevant trace flags are active, and no tests are running, your API header sets your logging levels. API requests that are sent without debugging headers generate transient logs—logs that aren’t saved—unless another logging rule is in effect.
- If you enable system logs for a user, you get debug logs for that user’s next 20 requests.
- If your entry point sets a log level, that log level is used. For example, Visualforce requests can include a debugging parameter that sets log levels.