> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Inspect sandbox logs

> Find a sandbox's log entries for a failed operation, and inspect image build output in the dashboard.

Use logs when an agent's task fails or produces an unexpected result. Start
with the command's exit status, stdout, and stderr, then find the sandbox's
log entries around the time of the operation. Logs are available until the
sandbox is deleted.

## Inspect sandbox logs

1. In the [Baseten dashboard](https://app.baseten.co), choose **Sandboxes**,
   then choose the sandbox.
2. On the sandbox's detail page, choose **Logs**.
3. Select the time range that contains the operation, and use the log-level
   filters to narrow the entries.

## Inspect image build logs

For a `FAILED` result when [building or importing an image](/sandboxes/manage-images#create-a-custom-image):

1. In **Sandboxes** > **Images**, choose the image whose build failed.
2. Choose **Logs**.

This view shows build output. The sandbox's **Logs** tab covers the running
sandbox's execution.

**To read build logs with the API**:

Request the image's logs with a
[sandbox access token](/sandboxes/authentication):

<CodeGroup>
  ```bash Request theme={"system"}
  curl --url "https://api.baseten.co/v1/sandboxes/images/${IMAGE_NAME}/logs?limit=100" \
    --header "Authorization: Bearer $SANDBOX_TOKEN"
  ```

  ```json Response theme={"system"}
  {
    "logs": [
      {
        "message": "=== total 8.87s | rootfs 419 MiB | 84 part(s)",
        "severity": 9,
        "timestamp": "2026-10-01T18:32:42Z"
      },
      ...
    ],
    "total_count": 71
  }
  ```
</CodeGroup>

The response covers the image's latest build, newest entry first, from the
last 24 hours by default. To page through more entries, add `&offset=<N>`.

To compare errors with request traffic and resource usage, see
[sandbox metrics](/sandboxes/metrics).
