Print this page

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, , 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
Value: debug_logs

To set this cookie via Chrome, Navigate to the Site URL,
Go to Developer tools and then to Console tab, Execute the below javascript
document.cookie ="debug_logs=debug_logs;";

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://*********");
    URLConnection con = url.openConnection();
    con.setRequestProperty("Cookie", "debug_logs=debug_logs,");
    con.setRequestProperty("Content-Type", "text/plain; charset=utf-8");


promote demote