1

I've created a public site with a RESTful service mentioned in this blog, however this site uses Guest User License and I can't see any debug statements when this webservice is used by Postman.

Is this intended or am I missing something? Is there way to track the callouts made without using a custom object for logging?

Any help is greatly appreciated.

@HttpPost
global static String doPost() {
    RestRequest req = RestContext.request;
    Blob body = req.requestBody;
    String requestString = body.toString();

    BO_LeadFormWebservice wrapper = (BO_LeadFormWebservice) JSON.deserialize(requestString, BO_LeadFormWebservice.class);
    System.debug('incoming payload');
    System.debug(wrapper);

    String result;

    if(wrapper.google_key != null){
        result = wrapper.google_key;
    }

    return result;
}

2 Answers 2

3

For anyone looking at this in the future, this post has solved my issue: StackExchange Post. You need to set your site name as your as the user name and it will show up in debug logs (without setting a cookie).

1
  • 1
    Every force.com site has a guest user which needs to be selected for the debug logs. set your site name as your as the user name: this statement is confusing.
    – Raul
    Dec 25, 2019 at 14:58
1

No debug logs available for guest user since Winter 17 as the latest answer to this question explains. So, your best shot is a try/catch + custom log.-

2
  • 2
    As a possible solution, I found this post
    – Atlas Can
    Dec 25, 2019 at 12:37
  • Oh, very useful! Thanks for sharing
    – Ideasforce
    Dec 25, 2019 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.