Debug logs for Site Guest User
Please follow below steps
- Ask the user to set a browser cookie with a domain of .force.com, a name of debug_logs, and any value. Refer to the documentation for your user’s browser for information on adding cookies. To add cookies, your user probably needs a browser plug-in or extension for web development.
- To set a cookie for API requests made with Java code, use the URLConnection class and set the cookie value as follows.
URL url = new URL("http://yourSite.force.com/"); URLConnection con = url.openConnection(); con.setDoOutput(true); con.setRequestProperty("Cookie", "debug_logs=debug_logs,domain=.force.com"); con.setRequestProperty("Content-Type", "text/plain; charset=utf-8"); con.connect();
- To set a browser cookie in Google Chrome™:
- Navigate to your site.
- Open the Chrome DevTools Console by pressing Ctrl+Shift+J (Cmd+Opt+J on macOS).
- Execute this command.
document.cookie="debug_logs=debug_logs;domain=.force.com";
- To set a browser cookie in other browsers, install a plug-in or extension.
- To set a cookie for API requests made with Java code, use the URLConnection class and set the cookie value as follows.
- Find the name of your site’s guest user.
- From Setup, enter Sites in the Quick Find box, then select Sites.
- Select your site from the Site Label column.
- Select .
- Set a user-based trace flag on the guest user.
- From Setup, enter Debug Logs in the Quick Find box, then click Debug Logs.
- Click New.
- Set the traced entity type to User.
- Open the lookup for the Traced Entity Name field, and then find and select your guest user.
- Assign a debug level to your trace flag.
- Click Save.
No comments:
Post a Comment