Setting Debug logs for Site Guest User (Winter 17)
|Knowledge Article Number||000247187|
|Description||While troubleshooting sites, The developer may set the debug logs for the Site Guest User. When the end user tries to access it, The system will not
produce any debug logs. This issue is related to the Wnter 17 change where the user has to set a special cookie from their side so that Salesforce will generat logs only when that user accesses the site.
|Resolution||As per the below documentation on Winter 17, https://releasenotes.docs.salesforce.com/en-us/winter17/release-notes/rn_forcecom_debugging_guest_user.htm#rn_forcecom_debugging_guest_user , The debug logs are collected for site visitors who are using the Guest User license only when a public user’s browser has a special cookie.
The value of the cookie should be
Name : debug_logs
To set this cookie via Chrome, Navigate to the Site URL,
Also if you access the site using API, you can set the cookie in the same format. For example, when connecting to the site using JAVA, you can
use URLConnection class and set the cookie value as below
URL url = new URL("http://*********-developer-edition.gus.force.com/");
URLConnection con = url.openConnection();
con.setRequestProperty("Content-Type", "text/plain; charset=utf-8");