> For the complete documentation index, see [llms.txt](https://paperspace.gitbook.io/gradient/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paperspace.gitbook.io/gradient/master/experiments/using-experiments/experiment-logs.md).

# Experiment Logs

Log streaming is available in both the web UI and CLI.  It is also possible to stream logs using the SDK. &#x20;

{% tabs %}
{% tab title="Web UI" %}
Navigate to a Job run part of an Experiment to view its logs.  These logs are streamed in realtime while the Experiment runs.  There are a few options such as Search, View all Logs, and Download Logs available on the page. &#x20;

![](https://1320806315-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHZRFUkajubOAmgu6Rd%2F-M-MI_3XhSfdSoGjVb2k%2F-M-MItL75cXEIlmFmnSo%2Fimage.png?alt=media\&token=8934e480-00cc-4420-8280-9337fa33e7c4)
{% endtab %}

{% tab title="CLI" %}
You can stream logs while the Experiment is running or after it has stopped.‌

### Example Use

```bash
gradient experiments logs --experimentId <id>
```

### ‌Example Output

```
Hello Paperspace
Creating file /artifacts/myoutput1.txt
Creating file /artifacts/myoutput2.txt
Finished; returning exit code 0
```

‌**Properties**

| Name           | Type   | Attributes  | Description                                                                                   |
| -------------- | ------ | ----------- | --------------------------------------------------------------------------------------------- |
| `experimentId` | string | Required    | Id of the experiment to view logs for.                                                        |
| `follow`       | string | \<optional> | ​Content                                                                                      |
| `line`         | number | \<optional> | Optional; if line is specified logs only logs after that line will be returned (up to limit). |
| `limit`        | number | \<optional> | Optional; number of log lines to retrieve on each request; default limit is 2000.             |
| {% endtab %}   |        |             |                                                                                               |

{% tab title="SDK" %}
While using the SDK, you can print the logs of an Experiment.

```python
#create a log stream & print all logs for the duration of experiment
log_stream = experiment_client.yield_logs(experiment_id)
print("Streaming logs of experiment")
try:
    while True:
        print(log_stream.send(None))
except:
    print("done streaming logs")
```

{% endtab %}
{% endtabs %}
