# Query logs and spans

Tilebox stores workflow logs and spans for each job. Query them when you need structured diagnostics outside the Console, such as in notebooks, scripts, or agent loops.

## Query from the command line

Use JSON output when another tool or agent will parse the result.

```bash
tilebox job logs <job-id> --json
tilebox job spans <job-id> --json
```

Limit or sort the output during debugging.

```bash
tilebox job logs <job-id> --limit 10 --sort desc
```

## Query from Python

Use the jobs client in notebooks and scripts.

```python title="Python"
from tilebox.workflows import Client

client = Client()
job = client.jobs().find("019e07b1-916b-0630-f3ba-f1c33235d174")

logs = client.jobs().query_logs(job)
spans = client.jobs().query_spans(job.id)

logs_df = logs.to_pandas()
spans_df = spans.to_pandas()
```

## Use the detailed reference pages

[Query telemetry](/docs/workflows/run-and-inspect/query-telemetry)

Query logs and spans from Python and Go.

[Logging](/docs/workflows/run-and-inspect/logging)

Emit structured logs from workflow tasks.

[Tracing](/docs/workflows/run-and-inspect/tracing)

Add custom spans around important parts of task code.

[Axiom integration](/docs/workflows/run-and-inspect/integrations/axiom)

Export workflow telemetry to Axiom.
