How to Debug Log Order of Precedence
- The trace flags 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. You can set trace flags in the Developer Console or in Setup or by using the TraceFlag and DebugLevel Tooling API objects. Note Setting class and trigger trace flags doesn’t cause logs to be generated or saved. Class and trigger trace flags override other logging levels, including logging levels set by user trace flags, but they don’t cause logging to occur. If logging is enabled when classes or triggers execute, logs are generated at the time ofexecution.
-
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 your entry point sets a log level, then that log level is used. For example, Visual force requests can include a debugging parameter that sets log levels.