Skip to content

Cloudflare Workers Logging

Cloudflare Workers Logging gives your agents access to Workers telemetry data — request logs, console output, and errors generated by your Cloudflare Workers. This is useful for debugging Worker behavior, tracing request flows, and identifying error patterns.

Once connected, agents can:

  • Query logs — search and filter Workers telemetry data including HTTP request logs, console.log output, and uncaught exceptions.
  • List available log keys — discover which fields are available in your Workers telemetry data.
  • List values for specific keys — explore the distinct values for any log field to understand your data.

The default lookback period is 24 hours, with a maximum of 7 days.

To set up this connection, you will need:

  1. API Token — a Cloudflare API token with Workers read permissions.
  2. Account ID — your Cloudflare account identifier.
  3. Script Name (optional) — the name of a specific Worker to scope logs to.
  1. Go to dash.cloudflare.com.
  2. Click your profile icon in the top-right corner and select My Profile.
  3. Go to the API Tokens tab.
  4. Click Create Token.
  5. You can either:
    • Use the Read All Resources template for broad read access, or
    • Click Create Custom Token and grant the following permissions:
      • Account > Workers Scripts > Read
      • Account > Workers Tail > Read
  6. Complete the token creation flow and copy the token immediately — it will not be shown again.
  1. Log in to the Cloudflare dashboard at dash.cloudflare.com.
  2. Select any domain, or navigate to Workers & Pages in the sidebar.
  3. Your Account ID is displayed in the right sidebar under Account details.
  4. It is a 32-character hexadecimal string (e.g., a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6).

If you want to scope log queries to a specific Worker, enter the Worker’s script name. This is the name shown in your Workers & Pages dashboard.

If you leave this field blank, agents will query logs across all Workers in your account.

  1. In OpsTower, navigate to Connections in the sidebar.
  2. Click Add Connection and select Cloudflare Workers Logging.
  3. Enter your API Token and Account ID.
  4. Optionally enter a Script Name to limit queries to a specific Worker.
  5. Save the connection.

Once the connection shows a green status indicator, you can enable it on any Debugger agent to start querying your Workers telemetry.