Print this page

How to debug a system user?

Knowledge Article Number 000231873
Description The standard "debug logs" page does not allow you to set up a debug log for certain users such as the S2S connection users or automated users.
Resolution You can use the Tooling API to create a new trace flag (debug log ) for this type of users. 
  1. Log into Workbench https://workbench.developerforce.com/login.php
  2.  Navigate to Utilities > REST Explorer
  3.  Select POST, enter the URI below, and use the example body provided
/services/data/v35.0/tooling/sobjects/TraceFlag/


 "TracedEntityId" : "005i0000002Xx2qAAC", 
 "ExpirationDate" : "2016-01-07T15:04:31.000+0000", 
 "DebugLevelId" : "7dli0000000GmaEAAS", 
 "LogType" : "USER_DEBUG", 
 "StartDate" : "2016-01-07T14:34:31.000+0000" 
 }

 
TracedEntityId: The User ID for the user you want to debug, you can obtain this by querying the record that was created or updated by this user.

ExpirationDate: indicates the end date/time for this debug.

LogType : This option is used to select an existing debug level.

DebugLevelId: When the LogType is specified, you must specify a debug level id*

*You can obtain the DebugLevelID value by issuing the query below in the developer console or in workbench.

SELECT Id, DeveloperName FROM DebugLevel

For a complete list of fields  and option to set up a TraceFlag see:

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_traceflag.htm?search_text=traceflag




promote demote