Workflow: Generating a HAR file for troubleshooting

In this tutorial, you're going to learn how to generate network requests and error logs that Customer Support requests to troubleshoot issues. A team member can ask you to record a HTTP Archive (HAR) file or a log of network requests when an issue occurs. To help troubleshoot issues, include browser console logs in addition to the HAR file. Similarly, you can also collect Windows log files in addition to HAR files. Note: A HAR file includes data such as the content of cookies and the pages you download when you record. Anyone with access to the HAR file can view the data you submit during the record process, which can include personal or sensitive data. Secure HAR files accordingly. Cloudflare released a HAR sanitizer to strip sensitive information. This workflow includes these steps: Instructions to generate HAR files Select the tabs to read the instructions to generate a HAR file and console logs in the browser you use.

Expand all tabs



document.addEventListener('DOMContentLoaded', function () {
const toggleBtn = document.getElementById('master-toggle');

toggleBtn.addEventListener('click', function () {
const action = this.getAttribute('data-action');
const headers = document.querySelectorAll('.accordion');

headers.forEach(header => {
const isActive = header.classList.contains('active');
const panel = header.nextElementSibling; // Grabs the corresponding .panel container

if (action === 'expand' && !isActive) {
// Open it by simulating a standard click
header.click();
} else if (action === 'collapse' && isActive) {
// Close it by simulating a standard click
header.click();
}
});

// Flip button text and states
if (action === 'expand') {
this.setAttribute('data-action', 'collapse');
this.textContent = 'Collapse all tabs';
} else {
this.setAttribute('data-action', 'expand');
this.textContent = 'Expand all tabs';
}
});
});
Generate a HAR file in Chrome
To generate a HAR file in Chrome:

Open Chrome and go to the page where the issue occurs
Look for the ⋮ button and select More Tools > Developer Tools

Select the Network tab from the panel. Keep the menu open when you reproduce the issue. Optional: If Customer Support requests a HAR file with WebSockets, select the Socket option in the Network tab. Reload the browser to view the traffic over the WebSocket. The Socket option does not capture all logs when you download the HAR file, but only filters the display and downloads WebSocket logs.

Look for a round record button in the upper-left corner of the tab and ensure it is red. If it is grey, click the button to start the record process.
Check the Preserve log box
Click the grey crossed circle button to clear existing logs from the network tab
Reproduce the issue when the network records requests

Click the download button, Export HAR, to download and save the file to your computer and select Save as HAR with Content.


Upload the HAR file to the ticket for further investigation. See Instructions to send HAR files.

The instructions are the same for a Mac or Windows computer. The animation shows the steps to retrieve a HAR file in Chrome.

For issues with file generation, capture web session traffic.
If you generate an empty HAR file with zero bytes, turn on HAR exports with sensitive data.
To retrieve console logs in Chrome:

Open the Main Menu for Chrome
Go to More Tools > Developer Tools

Open the Console tab and screenshot any errors

Generate a HAR file in Firefox
To generate a HAR file in Firefox:

Open Firefox and go to the page where the issue occurs
Open the Network Monitor

Reproduce the issue when the network records requests

Right-click anywhere under the File column and click Save All As HAR


Save the HAR file in a convenient location
Upload the HAR file to the ticket for further investigation. See Instructions to send HAR files.

The instructions are the same for a Mac or Windows computer. Use the Network Monitor for issues with file generation in Firefox.
To retrieve console logs in Firefox:

In the Tools menu, select Web Developer

Console logs appear in a separate window
Screenshot any errors

Generate a HAR file in Safari
To generate a HAR file in Safari:

Open Safari and go to the Develop menu. If you do not see the Develop menu, see Use the developer tools in the Develop menu in Safari on Mac.
Select Show Web Inspector

Click the Network tab. Keep it open when you reproduce the issue.
Reproduce the issue when the network records requests
Click the Export icon and save the HAR file

Upload the HAR file to the ticket for further investigation. See Instructions to send HAR files.

For issues with file generation in Safari, use the Web Inspector.
To retrieve console logs in Safari:

Open Preferences and go to the Advanced tab
Select Show Developer menu in the menu bar
Close Preferences
In the menu bar, select Developer > Show error console

Screenshot any errors

Generate HAR files across multiple browser tabs in a Chromium-based browser
To set up a Chromium-based browser to generate HAR files across multiple browser tabs:

With a browser open, open the Developer Tools drawer. Alternatively, open the browser Settings menu and then select More tools > Developer Tools.

Open the Settings for the Developer tools drawer
Scroll to the Global settings area and select the option Auto-open DevTools for popups

Close the Settings menu
Navigate to a page where you want to record a HAR file and ensure the Developer tools drawer is open

As long as the Developer tools drawer remains open, any pages or tabs you open from links on the page also open with the Developer tools drawer open and start a HAR file record process.
Instructions to send HAR files Before you send a HAR file to Zendesk:
Rename and zip or compress HAR files
Uncompressed HAR files are often over Zendesk attachment limits
By default, HAR files use the page URL as the file name
Files with .com extensions look suspicious to spam and phishing filters. Give the HAR file a descriptive name that does not include the full URL.
Additional resources If you experience issues with your account, use troubleshooting guides to diagnose the issue. If you are not a Zendesk customer yet, register for a Zendesk trial.