Without the log service

Where to read output without the log service: background commands' logs, containers, connections to private addresses, and a browser's console in your own tests.

  • A background: true command returns its logPath, /work/.sbx/logs/<bgId>.log: sandbox_exec { "id": "<id>", "cmd": "tail -n 100 /work/.sbx/logs/<bgId>.log", "note": "read the dev server output" }. sandbox_status.running.background lists running ones with logPath, and running.containers the containers with their ports. sandbox_procs with action: "list" returns every background command, finished ones included, with the end of its log (up to the last 16 KB) as logTail.
  • Containers: docker compose logs --tail 100 <service> or docker logs --tail 100 <container> through sandbox_exec.
  • Connections to an environment's private addresses: /work/.sbx/logs/private-endpoints.log, one line per failure.
  • The box does not capture a browser's console or network traffic. Tests you run can listen for them and print them, for example with Playwright: page.on('console', m => console.log(m.type(), m.text())), page.on('pageerror', e => console.log(e.message)), page.on('requestfailed', r => console.log(r.url(), r.failure()?.errorText)). For a page a person has open at one of the box's URLs, sandbox_scene reads its state; sandbox_shot shows the box's screen.

Every tool and topic is listed in the tool reference.