---
title: "Reference: Mastra.listLogsByRunId() | Core"
description: "Documentation for the `Mastra.listLogsByRunId()` method in Mastra, which retrieves logs for a specific run ID and transport ID."
packages:
  - "@mastra/core"
---

# Mastra.listLogsByRunId()

The `.listLogsByRunId()` method is used to retrieve logs for a specific run ID and transport ID. This method requires a configured logger that supports the `listLogsByRunId` operation.

## Usage example

```typescript
mastra.listLogsByRunId({ runId: "123", transportId: "456" });
```

## Parameters

<PropertiesTable
  content={[
    {
      name: "runId",
      type: "string",
      description: "The run ID to retrieve logs for.",
    },
    {
      name: "transportId",
      type: "string",
      description: "The transport ID to retrieve logs from.",
    },
    {
      name: "fromDate",
      type: "Date",
      description:
        "Optional start date for filtering logs. e.g., new Date('2024-01-01').",
      optional: true,
    },
    {
      name: "toDate",
      type: "Date",
      description:
        "Optional end date for filtering logs. e.g., new Date('2024-01-31').",
      optional: true,
    },
    {
      name: "logLevel",
      type: "LogLevel",
      description: "Optional log level to filter by.",
      optional: true,
    },
    {
      name: "filters",
      type: "Record<string, any>",
      description: "Optional additional filters to apply to the log query.",
      optional: true,
    },
    {
      name: "page",
      type: "number",
      description: "Optional page number for pagination.",
      optional: true,
    },
    {
      name: "perPage",
      type: "number",
      description: "Optional number of logs per page for pagination.",
      optional: true,
    },
  ]}
/>

## Returns

<PropertiesTable
  content={[
    {
      name: "logs",
      type: "Promise<any>",
      description:
        "A promise that resolves to the logs for the specified run ID and transport ID.",
    },
  ]}
/>

## Related

- [Logging overview](/docs/v1/observability/logging)
- [Logger reference](/reference/v1/logging/pino-logger)
