> ## 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/typescript/classes/monitor) write path. It lists recent traces as lightweight metadata and exposes two nested sub-clients for typed search over traces and spans.

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

## Access

```typescript theme={null}
import { Adaline } from '@adaline/client';

const adaline = new Adaline();
const logs = adaline.logs; // LogsClient
```

The class is also exported directly:

```typescript theme={null}
import { LogsClient } from '@adaline/client';
```

## Sub-clients

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

Types from `@adaline/api`:

```typescript theme={null}
import type { ListLogsResponse } from '@adaline/api';
```

***

## list()

List log traces in a project — lightweight metadata only (no span bodies). Use filters to narrow the window, then pass the cursor to paginate.

```typescript theme={null}
list(options: {
  projectId: string;
  startedAfter?: number;
  startedBefore?: number;
  status?: 'success' | 'failure' | 'aborted' | 'cancelled' | 'pending' | 'unknown';
  name?: string;
  referenceId?: string;
  sessionId?: string;
  sort?: 'startedAt:asc' | 'startedAt:desc';
  limit?: number;
  cursor?: string;
  filters?: string;
}): Promise<ListLogsResponse>
```

### Parameters

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | Project to list traces for. |
| `startedAfter` | `number` | No | Unix milliseconds — traces started after this instant. |
| `startedBefore` | `number` | No | Unix milliseconds — traces started before this instant. |
| `status` | enum | No | Filter by trace status. |
| `name` | `string` | No | Filter by trace name (exact match, max 256 chars). |
| `referenceId` | `string` | No | Filter by client-supplied reference ID. |
| `sessionId` | `string` | No | Filter by session ID. |
| `sort` | enum | No | Sort order, default `"startedAt:desc"`. |
| `limit` | `number` | No | Page size (1-200, default 50). |
| `cursor` | `string` | No | Cursor from a previous response. |
| `filters` | `string` | No | JSON-encoded array of filter objects (max 20). Each filter has `type`, `column`, `operator`, `value`. See [Export Logs](https://www.adaline.ai/docs/monitor/filter-and-search-logs.md). |

### Returns

`Promise<ListLogsResponse>` with `{ data: TraceMetadata[]; pagination: Pagination }`. Span bodies are **not** included — use [`logs.spans.search`](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/log-spans) or [`logs.traces.search`](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/log-traces) for richer payloads.

### Example

```typescript theme={null}
const { data, pagination } = await adaline.logs.list({
  projectId: 'project_abc123',
  status: 'failure',
  startedAfter: Date.now() - 24 * 60 * 60 * 1000, // last 24 hours
  sort: 'startedAt:desc',
  limit: 100,
});

for (const trace of data) {
  console.log(trace.id, trace.name, trace.status);
}
```

***

## See Also

* [LogTracesClient](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/log-traces.md) — typed trace search + retroactive update
* [LogSpansClient](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/log-spans.md) — typed span search with full bodies
* [Monitor](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/monitor.md) — write-side buffering and flushing
* [Adaline.initMonitor](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/adaline.md#initmonitor)
* 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.