The sandbox itself
Logs
The sandbox's durable debug record
On this page(3 sections)
What log files exist, and a window of one. Captured terminal output, command runs, and the daemon's own log.
GET/logsLogs 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 |
|---|---|
filesEvery log the sandbox keeps: captured… | object[] |
nameIts name, which is what the… | string |
sizeBytesSize in bytes | number |
modifiedAtWhen it last changed, in milliseconds | number |
answered in this tab
curl "$SANDBOX/logs" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.logs.list();GET/logs/fileRead 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 |
|---|---|---|
namerequiredWhich log | string | query |
bytesHow much of the end to… | number | query |
What comes back
| Field | Type |
|---|---|
nameWhich log this is from | string |
sizeBytesHow large the whole file is | number |
textThe end of it, as text | string |
truncatedThere is more before what you… | boolean |
answered in this tab
curl "$SANDBOX/logs/file?name=nightly%20changelog" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.logs.read({
"name": "nightly changelog"
});POST/logs/clientReport 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 |
|---|---|---|
eventsrequiredWhat the browser has to report,… | object[] | body |
seenAtrequiredWhen the browser saw it, in… | number | body |
levelrequiredHow bad it was | "warn" | "error" | body |
eventrequiredWhat kind of thing it was,… | string | body |
messagerequiredWhat it said | string | body |
routeWhich page they were on | string | body |
requestIdWhich daemon call it belonged to,… | string | body |
buildWhich build of the app was… | string | body |
fieldsWhatever else was worth keeping | object | body |
pageWhich page load sent the batch | object | body |
pageIdrequiredThis page load's own id: every… | string | body |
tabIdThe browser tab's id, which a… | string | body |
userAgentThe browser's own description of itself | string | body |
viewportThe window's size in CSS pixels… | string | body |
replayThe PostHog session id, whose replay… | string | body |
originThe address the page was loaded… | string | body |
servedHow the page was served: `dev`… | string | body |
commitThe short commit the page's build… | string | body |
What comes back
| Field | Type |
|---|---|
recordedHow many were written down | number |
answered in this tab
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":"…"}}],"page":{"pageId":"a1b2c3d4","tabId":"a1b2c3d4","userAgent":"…","viewport":"…","replay":"…","origin":"…","served":"…","commit":"9f2c1ab3d4e5f60718293a4b5c6d7e8f90a1b2c3"}}'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": "…"
}
}
],
"page": {
"pageId": "a1b2c3d4",
"tabId": "a1b2c3d4",
"userAgent": "…",
"viewport": "…",
"replay": "…",
"origin": "…",
"served": "…",
"commit": "9f2c1ab3d4e5f60718293a4b5c6d7e8f90a1b2c3"
}
});More in The sandbox itself