> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-HK/llms.txt # Mastra.listLogsByRunId() `.listLogsByRunId()` 方法用於擷取特定 run ID 及 transport ID 的日誌。此方法需要已配置且支援 `listLogsByRunId` 操作的 logger。 ## 使用範例 ```typescript mastra.listLogsByRunId({ runId: '123', transportId: '456' }) ``` ## 參數 **runId** (`string`): 要擷取其日誌的 run ID。 **transportId** (`string`): 要從中擷取日誌的 transport ID。 **fromDate** (`Date`): 用於篩選日誌的可選開始日期,例如 new Date('2024-01-01')。 **toDate** (`Date`): 用於篩選日誌的可選結束日期,例如 new Date('2024-01-31')。 **logLevel** (`LogLevel`): 用於篩選的可選日誌級別。 **filters** (`Record`): 套用至日誌查詢的可選額外篩選條件。 **page** (`number`): 用於分頁的可選頁碼。 **perPage** (`number`): 用於分頁的可選每頁日誌數目。 ## 傳回值 **logs** (`Promise`): 一個 Promise,會 resolve 為指定 run ID 及 transport ID 的日誌。 ## 相關內容 - [日誌記錄概覽](https://mastra.zisheng.pro/zh-HK/docs/observability/logging) - [Logger 參考](https://mastra.zisheng.pro/zh-HK/reference/logging/pino-logger)