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

# celesto sandbox logs

> Use celesto sandbox logs to read a sandbox's boot and console log. Tail or follow it live to debug slow startups and shell or SSH connection problems.

`celesto sandbox logs` prints the host-side boot and console log for a sandbox. Reach for it when a sandbox is slow to become ready, when `shell` or `ssh` won't connect, or when you want to see what the guest kernel and init printed on the serial console.

## Synopsis

```bash theme={null}
celesto sandbox logs <sandbox> [OPTIONS]
```

## Arguments

**sandbox** `string` *required*

Name or ID of the sandbox to read logs from.

## Options

**--tail** `number` (default: 200)

Number of lines to show from the end of the log.

**-f, --follow** `flag`

Keep printing new log lines as they arrive. Exit with `Ctrl+C`.

**--json** `flag`

Emit a JSON envelope with the log content in `data` instead of streaming raw text.

## Examples

### Show the last 200 lines

```bash theme={null}
celesto sandbox logs my-sandbox
```

### Show more history

```bash theme={null}
celesto sandbox logs my-sandbox --tail 1000
```

### Watch a boot live

```bash theme={null}
celesto sandbox logs my-sandbox --follow
```

### Capture the log for a bug report

```bash theme={null}
celesto sandbox logs my-sandbox --tail 500 --json > sandbox.log.json
```

## How it behaves

The command reads the boot/console log that Celesto captures on the host, so it works even when the guest agent or SSH isn't reachable. `--follow` streams appended bytes through an incremental UTF-8 decoder, so multi-byte characters that span a read boundary aren't garbled, and the final line isn't split when the log lacks a trailing newline. Piping into a reader that closes early (for example `| head`) exits cleanly.

## Related commands

* [`celesto sandbox exec`](https://celesto.ai/docs/celesto/cli/exec) - Run a command in a sandbox from a script
* [`celesto sandbox shell`](https://celesto.ai/docs/celesto/cli/shell) - Open an interactive shell once the sandbox is up
* [`celesto doctor`](https://celesto.ai/docs/celesto/cli/doctor) - Check whether the host can run Celesto at all


## Related topics

- [celesto sandbox exec](https://celesto.ai/docs/celesto/cli/exec.md)
- [CLI overview](https://celesto.ai/docs/celesto/cli/overview.md)
- [celesto sandbox delete](https://celesto.ai/docs/celesto/cli/cleanup.md)
- [Run Docker in a Celesto sandbox](https://celesto.ai/docs/celesto/features/docker.md)
- [celesto sandbox prune](https://celesto.ai/docs/celesto/cli/sandbox-prune.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.