Skip to main content
Mastra v1 is coming in January 2026. Get ahead by starting new projects with the beta or upgrade your existing project today.

Mastra.listLogs()

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

Usage exampleDirect link to Usage example

mastra.listLogs("456");

ParametersDirect link to Parameters

transportId:

string
The transport ID to retrieve logs from.

options:

object
Optional parameters for filtering and pagination. See Options section below for details.

OptionsDirect link to Options

fromDate:

Date
Optional start date for filtering logs. e.g., new Date('2024-01-01').

toDate:

Date
Optional end date for filtering logs. e.g., new Date('2024-01-31').

logLevel:

LogLevel
Optional log level to filter by.

filters:

Record<string, any>
Optional additional filters to apply to the log query.

page:

number
Optional page number for pagination.

perPage:

number
Optional number of logs per page for pagination.

ReturnsDirect link to Returns

logs:

Promise<any>
A promise that resolves to the logs for the specified transport ID.

On this page