function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SATZSATZ 

Enable the user for debug log Automatically

Hi all.

Is there Any possible For Add The User In Debug Log Automatically Using Apex Code or Trigger.

Give me Any suggestions.

 

Regards

Satz..

 

sfdcfoxsfdcfox

Conceptually, it is possible, although you'll have a rough time of it. You'll need to extract the _CONFIRMATIONTOKEN from the page, then postback that token along with the parameters to set the user up. There's no API for this, though.

SATZSATZ

Hi.

Thanks for your reply ..I dont know how to get the _CONFORMATIONTOKEN for the user .

Plz say clearly the steps....

 

Thanks 

Satz..

sfdcfoxsfdcfox

I briefly experimented with this, but I didn't come up with a foolproof way of getting it immediately. You might try using Pattern and Matcher classes to see if you can extract it. I simply don't have time to get a working copy up and going. I'm not entirely confident that you should be trying to do this any ways. You are surely aware that there is a limit to the number of debug entries you can store at once, so this might not work well on a large scale. Plus, if you start logging every user at every chance, or if it runs amok, they might force you to rethink it.