---
title: "JobClient.query_logs"
description: "Query logs emitted while running a job. Pagination is handled automatically."
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.

# JobClient.query_logs

import { Fragment } from "astro/jsx-runtime";

import ApiReference from "@docs/components/ApiReference.astro";

import ParamField from "@docs/components/ParamField.astro";

```python
def JobClient.query_logs(job_id: Job | UUID | str) -> LogRecords
```

Query logs emitted while running a job. Pagination is handled automatically.

## Parameters

**job_id**

type: Job | UUID | str

required: true

The job, job ID, or job ID string to query logs for.

## Returns

A `LogRecords` list. Each `LogRecord` contains `time`, `severity_number`, `severity_text`, `body`, `trace_id`, `span_id`, `attributes`, and `runner_attributes`.

`LogRecords.to_pandas()` converts the records to a pandas DataFrame.

<h2 id="request-example">Usage example</h2>

```python
logs = client.jobs().query_logs(job)

for record in logs:
    print(
        record.time,
        record.severity_text,
        record.body,
    )

df = logs.to_pandas()
```

Source: https://tilebox.com/docs/api-reference/python/tilebox.workflows/JobClient.query_logs/index.mdx
