# 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 example

```typescript
mastra.listLogs('456')
```

## Parameters

**transportId** (`string`): The transport ID to retrieve logs from.

**options** (`object`): Optional parameters for filtering and pagination.

**options.fromDate** (`Date`): Optional start date for filtering logs. e.g., new Date('2024-01-01').

**options.toDate** (`Date`): Optional end date for filtering logs. e.g., new Date('2024-01-31').

**options.logLevel** (`LogLevel`): Optional log level to filter by.

**options.filters** (`Record<string, any>`): Optional additional filters to apply to the log query.

**options.page** (`number`): Optional page number for pagination.

**options.perPage** (`number`): Optional number of logs per page for pagination.

## Returns

**logs** (`Promise<any>`): A promise that resolves to the logs for the specified transport ID.

## Related

- [Logging overview](https://mastra.ai/docs/observability/logging)
- [Logger reference](https://mastra.ai/reference/logging/pino-logger)