> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/debugging-tests/network-logs.md).

# Network logs

How BugBug collects network logs (HAR) in local and cloud runs: the Basic, Full, Custom and Disabled modes, downloading the HAR file from runs history, how long it's kept, and opening it.

### Network Logs (HAR)

BugBug captures network activity during test runs, both local and cloud. This lets you inspect HTTP requests, responses, status codes, and timing to diagnose failures caused by API errors, slow endpoints, or unexpected redirects.

***

#### What is collected

Choose how much is collected in [Project settings](https://docs.bugbug.io/preventing-failed-tests/project-settings.md), in **Collect network logs**:

| Mode                  | What is collected                                                                  |
| --------------------- | ---------------------------------------------------------------------------------- |
| **Basic** (default)   | Fetch/XHR requests, documents and manifests.                                       |
| **Full network logs** | Also sockets, Wasm and other requests. The file with these logs can be very large. |
| **Custom**            | Your own list of request categories. The list is set through the API.              |
| **Disabled**          | Network logs aren't collected.                                                     |

Error responses (4xx/5xx) and transport errors are always collected, in every mode, also when network logs are disabled.

***

#### How to access network logs

1. Go to the [Runs history](https://docs.bugbug.io/debugging-tests/runs-history.md)
2. Go to the failed test run and click **Details**
3. Click **Download network logs (HAR)** to download the file

> 💡 The download link is also available directly in the failed step when the test failed.
>
> <img src="https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FG5TfJd7quc6GagIORGj3%2Fimage.png?alt=media&amp;token=44a0d7d6-6712-4ba2-b53a-4e85a3ac60e3" alt="" data-size="original">

<figure><img src="https://3168433179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKixgeBPbLvnD0l1eiV%2Fuploads%2FbqfYI4QInIUi9nyYGetD%2Fimage.png?alt=media&amp;token=bb90879e-1247-4bee-a337-bc90fa4aff2c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Network logs are kept for **3 days** after the run. After that, you can't download them anymore, so download the HAR file soon after the failure if you want to keep it.
{% endhint %}

***

#### What is a HAR file?

HAR (HTTP Archive) is a JSON-based standard that records the network requests made by the browser during a test. The file is compressed as a `.zip` archive containing a `.har` file inside.

Each entry in a HAR file includes:

* **URL** – the full request URL
* **Method** – GET, POST, PUT, etc.
* **Status code** – e.g. 200, 404, 500
* **Request & response headers**
* **Request body** (for POST/PUT requests)
* **Response body**
* **Timing** – how long each request took

***

#### How to open a HAR file

After downloading and unzipping the archive, you can open the `.har` file in several ways:

**Chrome DevTools**

1. Open Chrome DevTools → **Network** tab
2. Drag and drop the `.har` file into the Network panel

**Online viewers**

* [HAR Analyzer by Google](https://toolbox.googleapps.com/apps/har_analyzer/) — good for quick inspection
* [HAR Viewer](http://www.softwareishard.com/har/viewer/) — detailed timeline view

**Other tools**

* Firefox DevTools (Network tab → Import)
* Charles Proxy, Fiddler, Insomnia — for deeper analysis

***

#### Common debugging scenarios

**API returning an error**

Look for requests with status codes `4xx` or `5xx`. Check the response body for error messages from your backend.

**Test failing on page load**

Look for failed requests to JS bundles or critical API calls that happen right after navigation.

**Blocked requests**

A request with status `0` got no response. If the error is `net::ERR_BLOCKED_BY_CLIENT`, the browser blocked it, for example because of a [script blocking](https://docs.bugbug.io/preventing-failed-tests/blocking-scripts.md) rule in your project or another browser extension.

**Assertion failing unexpectedly**

Check if the data your test asserts against is fetched correctly — the response body will show what the server actually returned.

**Slow or timing-out steps**

Review the timing column to find requests that take unusually long and may be causing timeout failures.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bugbug.io/debugging-tests/network-logs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
