Skip to Content

Logs API

The Logs API provides methods to access and query system logs and debugging information in Mastra.

Initialize Mastra Client

import { MastraClient } from "@mastra/client-js"; const client = new MastraClient();

Getting Logs

Retrieve system logs with optional filtering:

const logs = await client.getLogs({ transportId: "transport-1", });

Getting Logs for a Specific Run

Retrieve logs for a specific execution run:

const runLogs = await client.getLogForRun({ runId: "run-1", transportId: "transport-1", });