19

Recently our team has noticed that turning on the Debug Logs for a Site Guest User has stopped working. Prior to the Winter 17 release, if you turned on Debug Logs for a Site Guest User, logs appear like they do for any other user.

I couldn't find any relevant information in Google on this topic, and finally got an answer from Salesforce Tech support, so I am posting it here.

1

1 Answer 1

26

The answer we received from Salesforce Tech support is that before the Winter 17 release, if you turned on debugging for a Site Guest User, you might receive an avalanche of debug logs if many different people were accessing your Force.com site at the same time.

After the Winter 17 release, you now also need to set a server cookie in the browser to enable debug logs for Site Guest Users. This means that debug logs will only be generated for those doing the debugging, not everyone accessing the site. This is true for sandboxes also.

An easy way to set this cookie in Chrome is to use the Javascript developer console. First, be sure your Chrome settings are set to "Allow local data" and "Allow both first-party and third-party cookies".

Next, navigate to the Force.com site page that you want to debug. Open the Javascript console and enter the following (note that you need the "." at the beginning of '.force.com')

document.cookie="debug_logs=.force.com;domain=.force.com"

If you look in Chrome's Cookie settings you should now see a 'debug_logs' cookie, and so the next time you reload your page, debug logs should re-appear again.

There is more documentation on Debug Logs here, but at the time of this writing, adding the cookie is not documented:

Salesforce: Set up Debug Logging

2
  • 1
    You may want to mark your answer as accepted so it comes out of the unanswered questions queue.
    – Dave Humm
    Commented Oct 7, 2016 at 16:56
  • 3
    Something a little more useful: document.cookie="debug_logs=.force.com;domain=.force.com; expires=Wed, 01 Jan 2025 00:00:00 GMT";
    – Jph108
    Commented Jan 19, 2017 at 19:04

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