Skip to main content

LogsClient

adaline.logs is the read-side counterpart to the Monitor write path. It lists recent traces as lightweight metadata and exposes two nested sub-clients for typed search over traces and spans.
The write-side — buffering and flushing traces and spans — lives on the Monitor, Trace, and Span classes, created via adaline.initMonitor(). LogsClient is strictly read / retroactive patch.

Access

import { Adaline } from '@adaline/client';

const adaline = new Adaline();
const logs = adaline.logs; // LogsClient
The class is also exported directly:
import { LogsClient } from '@adaline/client';

Sub-clients

PropertyClientCovers
adaline.logs.tracesLogTracesClientTyped trace search and retroactive trace updates
adaline.logs.spansLogSpansClientTyped span search with full span bodies
Types from @adaline/api:
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.
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

NameTypeRequiredDescription
projectIdstringYesProject to list traces for.
startedAfternumberNoUnix milliseconds — traces started after this instant.
startedBeforenumberNoUnix milliseconds — traces started before this instant.
statusenumNoFilter by trace status.
namestringNoFilter by trace name (exact match, max 256 chars).
referenceIdstringNoFilter by client-supplied reference ID.
sessionIdstringNoFilter by session ID.
sortenumNoSort order, default "startedAt:desc".
limitnumberNoPage size (1-200, default 50).
cursorstringNoCursor from a previous response.
filtersstringNoJSON-encoded array of filter objects (max 20). Each filter has type, column, operator, value. See Export Logs.

Returns

Promise<ListLogsResponse> with { data: TraceMetadata[]; pagination: Pagination }. Span bodies are not included — use logs.spans.search or logs.traces.search for richer payloads.

Example

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