Query Worker Logs
query_worker_logsRetrieve recent logs from a Cloudflare Worker to inspect messages, outcomes, requests, and timings. Filter by search, error-only, time window, and result limit for diagnostics.
Instructions
Query a Worker's logs (Workers Logs / observability). Returns the most recent matching events with message, outcome, request, and timing. The Worker must have observability enabled (deploy_worker's enable_observability or update_worker_settings).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum events to return (default 20) | |
| search | No | Full-text needle matched across all log fields | |
| minutes | No | Look-back window in minutes (default 60; retention is 3–7 days) | |
| errors_only | No | Only return events that carry an error | |
| script_name | Yes | The Worker whose logs to query |