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

# Logs

# LogsClient

`adaline.logs` is the read-side counterpart to the [`Monitor`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/monitor) write path. It lists recent traces as lightweight metadata and exposes two nested sub-clients for typed search over traces and spans. Every method is async.

> [!NOTE]
>
> The **write-side** — buffering and flushing traces and spans — lives on the [`Monitor`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/monitor), [`Trace`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/trace), and [`Span`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/span) classes, created via [`adaline.init_monitor()`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/adaline#init_monitor). `LogsClient` is strictly read / retroactive patch.

## Access

```python theme={null}
from adaline.main import Adaline

adaline = Adaline()
logs = adaline.logs  # LogsClient
```

The class is also exported directly:

```python theme={null}
from adaline.clients import LogsClient
```

## Sub-clients

| Attribute | Client | Covers |
| - | - | - |
| `adaline.logs.traces` | [`LogTracesClient`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/log-traces) | Typed trace search and retroactive trace updates |
| `adaline.logs.spans` | [`LogSpansClient`](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/log-spans) | Typed span search with full span bodies |

Types from `adaline_api`:

```python theme={null}
from adaline_api.models.list_logs_response import ListLogsResponse
```

***

## list()

List log traces in a project — lightweight metadata only (no span bodies).

```python theme={null}
async def list(
    *,
    project_id: str,
    started_after: Optional[int] = None,
    started_before: Optional[int] = None,
    status: Optional[LogStatus] = None,
    name: Optional[str] = None,
    reference_id: Optional[str] = None,
    session_id: Optional[str] = None,
    sort: Optional[LogSort] = None,
    limit: Optional[int] = None,
    cursor: Optional[str] = None,
    filters: Optional[str] = None,
) -> ListLogsResponse
```

### Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| `project_id` | `str` | Yes | Project to list traces for. |
| `started_after` / `started_before` | `Optional[int]` | No | Unix millisecond bounds. |
| `status` | `Optional[LogStatus]` | No | `"success"`, `"failure"`, `"aborted"`, `"cancelled"`, `"pending"`, `"unknown"`. |
| `name` | `Optional[str]` | No | Filter by trace name. |
| `reference_id` | `Optional[str]` | No | Filter by client-supplied reference ID. |
| `session_id` | `Optional[str]` | No | Filter by session ID. |
| `sort` | `Optional[LogSort]` | No | `"startedAt:asc"` or `"startedAt:desc"`. |
| `limit` | `Optional[int]` | No | Page size (1-200, default 50). |
| `cursor` | `Optional[str]` | No | Cursor from a previous response. |
| `filters` | `Optional[str]` | No | JSON-encoded filter array. See [Export Logs](https://www.adaline.ai/docs/monitor/filter-and-search-logs.md). |

`LogStatus` and `LogSort` are string-alias enums re-exported from `adaline.clients.retry`.

### Returns

[`ListLogsResponse`](https://www.adaline.ai/docs/reference/api/v2/openapi/list-logs) with `{ data: list[TraceMetadata]; pagination: Pagination }`. Span bodies are **not** included.

### Example

```python theme={null}
import time

response = await adaline.logs.list(
    project_id="project_abc123",
    status="failure",
    started_after=int((time.time() - 24 * 3600) * 1000),  # last 24 hours
    sort="startedAt:desc",
    limit=100,
)

for trace in response.data:
    print(trace.id, trace.name, trace.status)
```

***

## See Also

* [LogTracesClient](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/log-traces.md) — typed trace search + retroactive update
* [LogSpansClient](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/log-spans.md) — typed span search with full bodies
* [Monitor](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/monitor.md) — write-side buffering and flushing
* [Adaline.init\_monitor](https://www.adaline.ai/docs/reference/sdk/v2/python/classes/adaline.md#init_monitor)
* API reference: [List log traces](https://www.adaline.ai/docs/reference/api/v2/openapi/list-logs.md)


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