---
title: "Query logs and spans"
description: "Query workflow logs and spans from the CLI or SDKs for debugging, reports, and automated diagnostics."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

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

# Query logs and spans

import { CardGrid } from "@docs/components/ui/card-grid";
import { LinkCard } from "@docs/components/ui/link-card";

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 logs and spans from Python and Go.

    Emit structured logs from workflow tasks.

    Add custom spans around important parts of task code.

    Export workflow telemetry to Axiom.

Source: https://tilebox.com/docs/guides/operations/query-logs-and-spans/index.mdx
