Mastra.listLogsByRunId()
.listLogsByRunId() 方法用于检索特定运行 ID 和传输 ID 的日志。此方法需要配置一个支持 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.
使用示例Direct link to 使用示例
🌐 Usage example
mastra.listLogsByRunId({ runId: "123", transportId: "456" });
参数Direct link to 参数
🌐 Parameters
runId:
string
The run ID to retrieve logs for.
transportId:
string
The transport ID to retrieve logs from.
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.
返回Direct link to 返回
🌐 Returns
logs:
Promise<any>
A promise that resolves to the logs for the specified run ID and transport ID.
相关Direct link to 相关
🌐 Related