4

Does anyone know how to enable debug logs for code executed through a REST interface? I have a stream of data that comes into Salesforce, but it is a nightmare trying to debug it based solely on the CMD console window. I had it working at one point, then it seems to have suddenly stopped.

My user is registered for debug logs, and I set Debug Levels for the specific classes within the developer window. But executing a curl command dumps the data in, but no logs appear in the developer window, nor the debug log page.

5
  • Did you uncheck Debug > Show My Current Logs Only in the Developer Console (default is checked)? You'll only see your own session that way. Also, users enabled for debugging in Setup > Monitoring > Debug Logs won't necessarily appear in the Developer Console.
    – sfdcfox
    Commented Dec 5, 2014 at 5:25
  • Yep, ive got Show Current Logs unchecked. I've also been switching between both debug locations and no logs appear in either. The strange thing is was working for a while, then one day it just quit. Commented Dec 5, 2014 at 5:34
  • I have some issues with debug logs in web service calls as well. One walkaround for this is to send yourself an email. It is tedious work but you can get the info
    – Lance Shi
    Commented Dec 5, 2014 at 7:03
  • That is basically how it is being done now, except we divert exceptions into help ticket records. One plus is that you can attach the JSON as an attachment, so you can easily re-execute data that may have caused the exception. It's just frustrating because when the log is working, it feels like I can work 10x faster. Commented Dec 5, 2014 at 21:32
  • The workaround I found for this was execute the debugging in a class... so the content of the REST class is VERY basic, only something short like 6/7 lines. Then run all of the code needed in a class and debug from that... I can scribble out a quick piece of code for you if you would like me to?
    – Tim
    Commented Feb 4, 2015 at 11:23

3 Answers 3

2

Post Winter '17, you may need to set a cookie if the user is a Guest user license: https://releasenotes.docs.salesforce.com/en-us/winter17/release-notes/rn_forcecom_debugging_guest_user.htm

1
  • this is no longer true as SFDC changed behavior as the cookie approach was too burdensome - help.salesforce.com/…
    – cropredy
    Commented Aug 7, 2018 at 23:26
2

Encountered the same issue. But, realized that I was calling the rest api with a different salesforce user than the one I logged into salesforce as to check the logs in the Developer console.

Using the same user account, I was able to see the logs.

0

I was frustrated with this -- I set up the debug log as directed but didn't see any being created. I was looking for the logs in the Dev Console -- they show up on the same SETUP page where you set up the logs. (face palm)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .