Introduction:
Logs play an important role in case analysis. There are scenarios wherein the Support team would request you to capture the logs while trying to replicate the issue. However, some issues take time to manifest. This article explains the steps to gather the necessary logs to help with the investigation.
Prerequisites:
Before capturing logs, ensure that you have enabled the following settings:
- Log XML HTTPRequests
- Show timestamps
- Preserve log upon navigation
To do so, please see the detailed steps explained in this article Capturing browser and client logs
Strategy:
Logs need to be collected from the time that the agent first logs in, however due to browser limitations, if the problem is not replicated within about 20 minutes the logs become too large and get corrupted. To avoid this, every 20 minutes (or 40 minutes with an 8GB RAM machine), after determining that the issue has NOT occurred, use the clear button on both the har and console tabs to manage the size of data capture and refresh the page with F5 command. Repeat this process until the problem is replicated. Before clearing the har file check for network errors as described in the Collecting Network HAR Logs section below. Remember that the error may manifest in the network logs before it is apparent to the agent, especially in periods of low activity, so check the logs before clearing them.
Collecting Console Logs
- Open Developer Tools using the keyboard shortcut F12.
- Then select the Console tab.
- Ensure you are collecting verbose level logs
4. Once the problem is replicated save the console logs either by:
a.) Right-click > Save as (text file)
b.) Select All to fill the Copy buffer, then Paste into a Notepad or Vim text file
Collecting Network HAR Logs
- Open Developer Tools using the keyboard shortcut F12.
- Then select the Network tab.
- Make sure that the Record button is Red. If it is grey, click it once to start recording.
- Check the box Preserve log.
5. Every 20 or 40 minutes check for errors by sorting the Status column to see if there was an error either with the call pattern (A) or (B) below. Error statuses are shown in red and are generally 4xx, 5xx, Cancelled, or Failed.
*Depending on the features enabled for your org, you may normally see either of the following calls from the Network Panel name section:
A.) incomingRequests, availability, chatSessions
B.) lpProxy?podId
If you see this lpProxy?podId series, the Support team would only be looking for errors in the particular payloads: incomingRequests, availability, chatSessions. To check, click on a lpProxy?podId line and view the Request Payload.
In the case below you will see it is a chatSessions request:
6. If the problem is not replicated quickly the logs can be corrupted. To avoid this, every 20 minutes (or 40 minutes with an 8GB RAM machine), use the clear button on both the har and console tabs to limit the size of data capture, until the problem is replicated or the network logs show errors of interest as stated in (A) or (B) above.
To clear out any existing logs from the Network tab, click the Clear button. do the same on the console tab.
7. If you see an error (non-2xx) response in the har file then Collect both the HAR and Console Logs.
8. To gather all the HAR logs, fill the copy buffer either by:
a.) Right-click and select Save all as HAR with content (recommended) or;
b.) Right-click and select Copy, then Copy all as HAR. Paste then Save.
Note: As these HAR files can get very large, you may need to use a more powerful text editor to paste them. Vim editor is ideal, Notepad may be good enough, Word should not be used.
Note: Due to the size of the logs you will likely need to upload them to a file server as they will exceed the size allowed by our ticketing system. The Support Team can provide an upload link if requested.