Skip to main content
Each organization can run up to 10 sandboxes at once. To raise this limit, contact support.
Start with a command’s process output: its stdout, stderr, and exit status. For activity across a time range, read the sandbox’s runtime logs; for a failed image build, read its build logs.

Inspect process output

Set up the Baseten CLI before running these commands. To read a process’s output:
  1. Set SANDBOX_NAME to the sandbox’s name:
  2. Replace worker with the name used when starting the process, then run the following command to print its stdout and stderr:
To read stdout and stderr separately: Run the following command:
For more information, see the baseten sandbox process commands. For SDK examples, see Run commands in a sandbox.

Inspect runtime logs

Runtime logs collect the output of every process in the sandbox, along with the sandbox’s own activity, such as the requests its API server handles. They include each process’s stdout at info level and its stderr at error level. The CLI doesn’t read runtime logs; use the API or the dashboard.
To retrieve a sandbox’s runtime logs:
  1. Set SANDBOX_TOKEN to a sandbox access token:
  2. Set SANDBOX_NAME to the sandbox’s name:
  3. Replace the start and end times with a range of up to 7 days that contains the operation, then run the following command:
The response lists entries newest first, up to 100 per page. A severity of 17 marks an error, such as a line a process wrote to stderr, and 9 marks info. When next_cursor isn’t null, repeat the request with the same time range and set cursor to its value to get the next page.For more information, see Get sandbox logs.

Inspect image build logs

Inspect the build logs when building or importing an image returns FAILED.
To retrieve image build logs:
  1. Set SANDBOX_TOKEN to a sandbox access token:
  2. Set IMAGE_NAME to the image’s name:
  3. Run the following command:
The response contains entries from the image’s latest build, newest first. The default time range is the last 24 hours.For more information, see Get image build logs.
To compare errors with request traffic and resource usage, see sandbox metrics.