---
title: "Logs · intentic sandbox API"
description: "The sandbox's durable debug record. Every route in the logs group of the intentic sandbox API, with its input, its answer and a playground."
url: "https://intentic.dev/api/logs/"
---

The sandbox itself

# Logs

The sandbox's durable debug record

**On this page (3 sections)**

- [Logs the sandbox keeps](#logs-list)
- [Read part of a log](#logs-read)
- [Report what the browser saw](#logs-report)

What log files exist, and a window of one. Captured terminal output, command runs, and the daemon's own log.

**GET`/logs` Logs the sandbox keeps**

Every log file the daemon owns: captured terminal output, command runs, and the daemon's own log. Read-only, because only the sandbox writes them.

### What you send

Nothing. Call it as it is.

### What comes back

| Field | Type |
| --- | --- |
| `files` Every log the sandbox keeps: captured… | object[] |
| `name` Its name, which is what the… | string |
| `sizeBytes` Size in bytes | number |
| `modifiedAt` When it last changed, in milliseconds | number |

Try it answered in this tab

curl

```bash
curl "$SANDBOX/logs" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.logs.list();
```

**GET`/logs/file` Read part of a log**

A window of one log file's text. A window rather than the whole thing, because a busy log outgrows any single answer.

### What you send

| Field | Type | Where |
| --- | --- | --- |
| `name` required Which log | string | query |
| `bytes` How much of the end to… | number | query |

### What comes back

| Field | Type |
| --- | --- |
| `name` Which log this is from | string |
| `sizeBytes` How large the whole file is | number |
| `text` The end of it, as text | string |
| `truncated` There is more before what you… | boolean |

Try it answered in this tab

curl

```bash
curl "$SANDBOX/logs/file?name=nightly%20changelog" \
 -H "x-intentic-control: $INTENTIC_TOKEN"
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.logs.read({
 "name": "nightly changelog"
});
```

**POST`/logs/client` Report what the browser saw**

Errors the app caught, stalls it measured, and recoveries it performed, written to a log of their own. The browser is the only witness to these, so without it a bug someone hit in their own browser leaves no record at all.

### What you send

| Field | Type | Where |
| --- | --- | --- |
| `events` required What the browser has to report,… | object[] | body |
| `seenAt` required When the browser saw it, in… | number | body |
| `level` required How bad it was | "warn" | "error" | body |
| `event` required What kind of thing it was,… | string | body |
| `message` required What it said | string | body |
| `route` Which page they were on | string | body |
| `requestId` Which daemon call it belonged to,… | string | body |
| `build` Which build of the app was… | string | body |
| `fields` Whatever else was worth keeping | object | body |

### What comes back

| Field | Type |
| --- | --- |
| `recorded` How many were written down | number |

Try it answered in this tab

curl

```bash
curl -X POST "$SANDBOX/logs/client" \
 -H "x-intentic-control: $INTENTIC_TOKEN" \
 -H "content-type: application/json" \
 -d '{"events":[{"seenAt":1,"level":"warn","event":"…","message":"Fix the flaky parser test","route":"…","requestId":"a1b2c3d4","build":"…","fields":{"src/app.ts":"…","README.md":"…"}},{"seenAt":1,"level":"error","event":"…","message":"Fix the flaky parser test","route":"…","requestId":"a1b2c3d4","build":"…","fields":{"src/app.ts":"…","README.md":"…"}}]}'
```

TypeScript

```typescript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.logs.report({
 "events": [
 {
 "seenAt": 1,
 "level": "warn",
 "event": "…",
 "message": "Fix the flaky parser test",
 "route": "…",
 "requestId": "a1b2c3d4",
 "build": "…",
 "fields": {
 "src/app.ts": "…",
 "README.md": "…"
 }
 },
 {
 "seenAt": 1,
 "level": "error",
 "event": "…",
 "message": "Fix the flaky parser test",
 "route": "…",
 "requestId": "a1b2c3d4",
 "build": "…",
 "fields": {
 "src/app.ts": "…",
 "README.md": "…"
 }
 }
 ]
});
```

More in The sandbox itself

[Previous ← Activity](https://intentic.dev/api/activity/)[Next Push notifications →](https://intentic.dev/api/push/)
