TraceFlag
Represents a trace flag that triggers an Apex debug log at the specified logging level.
Introduced in API version 25.0.
create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()
DELETE, GET, HEAD, PATCH, POST, Query
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Description: The log category level for Apex code. Includes information about Apex code. Can also include log messages generated by data manipulation language (DML) statements, inline SOQL or SOSL queries, the start and completion of triggers, the start and completion of test methods, and so on. The following are valid values.
This field is required.
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Description: The log category level for profiling information. Includes cumulative profiling information, such as the limits for your namespace, the number of emails sent, and so on. The following are valid values.
This field is required.
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Description: The log category level for callouts. Includes the request-response XML that the server is sending and receiving from an external Web service. The request-response XML is useful when debugging issues related to SOAP API calls. The following are valid values.
This field is required.
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Introduced: API version 63.0
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Description: The log category for database activity. Includes information about database activity, including every DML statement or inline SOQL or SOSL query. The following are valid values.
This field is required.
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: reference
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Sort, Update
-
Introduced: API version 35.0
-
Description: The ID of the debug level assigned to this trace flag. A debug level, which is a set of log category levels, can be assigned to multiple trace flags.
-
Relationship name: DebugLevel
-
Relationship type: relationship
-
Refers to: DebugLevel
-
Type: datetime
-
Required: No
-
Properties: Create, Filter, Nillable, Sort, Update
-
Description: The date and time that the trace flag expires.
ExpirationDatemust be less than 24 hours afterStartDate. Only one trace flag per traced entity can be active at a time. IfStartDateis null, the current time is used, and theExpirationDatemust be less than 24 hours from the current time.
This field is required.
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort
-
Introduced: API version 35.0
-
Description: The type of log to generate. The following are valid values.
-
CLASS_TRACING
-
DEVELOPER_LOG
-
PROFILING (reserved for future use)
-
USER_DEBUG
When you open the Developer Console, it sets a DEVELOPER_LOG trace flag to log your activities. USER_DEBUG trace flags cause logging of an individual user’s activities. CLASS_TRACING trace flags override logging levels for Apex classes and triggers, but don’t generate logs.
This field is required.
-
Possible values:
-
USER_DEBUG — USER_DEBUG
-
DEVELOPER_LOG — DEVELOPER_LOG
-
CLASS_TRACING — CLASS_TRACING
-
PROFILING — PROFILING
-
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Introduced: API version 43.0
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: datetime
-
Required: No
-
Properties: Create, Filter, Nillable, Sort, Update
-
Introduced: API version 35.0
-
Description: The date and time when the trace flag takes effect.
ExpirationDatemust be less than 24 hours afterStartDate. Only one trace flag per traced entity can be active at a time. IfStartDateis null,ExpirationDatemust be less than 24 hours from the current time.
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Description: The log category level for calls to all system methods, such as the
System.debugmethod. The following are valid values.
This field is required.
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: reference
-
Required: No
-
Properties: Create, Filter, Group, Sort
-
Description: A reference to the following:
-
Apex class
-
Apex trigger
-
User
This field is used with the LogType field. This field is required.
- Relationship name: TracedEntity
- Relationship type: polymorphic
- Refers to: ApexClass, User, ApexTrigger
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Description: The log category level for validation rules. Includes information about validation rules, such as the name of the rule, or whether the rule evaluated
trueorfalse. The following are valid values.
This field is required.
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Description: The log category level for 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. The following are valid values.
This field is required.
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Introduced: API version 39.0
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
-
Type: picklist
-
Required: No
-
Properties: Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
-
Description: The log category level for workflow rules. Includes information for workflow rules, such as the rule name and the actions taken. This field is required. The following are valid values.
-
Possible values:
-
NONE — None
-
INTERNAL — Internal
-
FINEST — Finest
-
FINER — Finer
-
FINE — Fine
-
DEBUG — Debug
-
INFO — Info
-
WARN — Warn
-
ERROR — Error
-
To diagnose a functional issue or a performance problem, use the TraceFlag object to set up logging for yourself or for another user. The following options are available.
- To set up logging for a specific user, set
LogTypetoUSER_DEBUGandTracedEntityIdto the ID of the user. This option can be configured only for a user, not for an Apex class or Apex trigger. - To set up logging level overrides for an Apex class or trigger, set
LogTypetoCLASS_TRACINGandTracedEntityIdto the ID of the Apex class or trigger.CLASS_TRACINGtrace flags override other logging levels, but don’t cause logs to be generated or persisted.