# Mastra.getLogs()
[EN] Source: https://mastra.ai/reference/core/getLogs

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

## Usage example

```typescript copy
mastra.getLogs("456");
```

## Parameters

<PropertiesTable
  content={[
    {
      name: "transportId",
      type: "string",
      description: "The transport ID to retrieve logs from.",
    },
    {
      name: "options",
      type: "object",
      description:
        "Optional parameters for filtering and pagination. See Options section below for details.",
      optional: true,
    },
  ]}
/>

### Options

<PropertiesTable
  content={[
    {
      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 transport ID.",
    },
  ]}
/>

## Related

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


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