> ## 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`](/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`](/docs/reference/sdk/v2/typescript/classes/monitor), [`Trace`](/docs/reference/sdk/v2/typescript/classes/trace), and [`Span`](/docs/reference/sdk/v2/typescript/classes/span) classes, created via [`adaline.initMonitor()`](/docs/reference/sdk/v2/typescript/classes/adaline#initmonitor). `LogsClient` is strictly read / retroactive patch.
</Note>

## 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`](/docs/reference/sdk/v2/typescript/classes/log-traces) | Typed trace search and retroactive trace updates |
| `adaline.logs.spans`  | [`LogSpansClient`](/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](/docs/monitor/filter-and-search-logs). |

### Returns

`Promise<ListLogsResponse>` with `{ data: TraceMetadata[]; pagination: Pagination }`. Span bodies are **not** included — use [`logs.spans.search`](/docs/reference/sdk/v2/typescript/classes/log-spans) or [`logs.traces.search`](/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](/docs/reference/sdk/v2/typescript/classes/log-traces) — typed trace search + retroactive update
* [LogSpansClient](/docs/reference/sdk/v2/typescript/classes/log-spans) — typed span search with full bodies
* [Monitor](/docs/reference/sdk/v2/typescript/classes/monitor) — write-side buffering and flushing
* [Adaline.initMonitor](/docs/reference/sdk/v2/typescript/classes/adaline#initmonitor)
* API reference: [List log traces](/docs/reference/api/v2/openapi/list-logs)
