跳转到主要内容

Log streams

import { Render, DashButton } from "~/components";

Tunnel logs record all activity between a cloudflared instance and Cloudflare's global network, as well as all activity between cloudflared and your origin server. These logs allow you to investigate connectivity or performance issues with a Cloudflare Tunnel. You can configure your server to store persistent logs, or you can stream real-time logs from any client machine.

View logs on the server

<Render file="tunnel/logs/view-logs-on-server" product="cloudflare-one" params={{ loglevelURL: "/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/run-parameters/#loglevel", logfileURL: "/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/run-parameters/#logfile", runParametersURL: "/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/run-parameters/#add-run-parameters-to-tunnel-service", }} />

View logs on your local machine

You can view real-time logs for a Cloudflare Tunnel via the dashboard or from any machine that has cloudflared installed. With remote log streams, you do not need to SSH into the server that is running the tunnel. To get remote logs, the tunnel must be active and able to receive requests.

Dashboard

:::note Tunnel log streams require edit permissions for Cloudflare Tunnel. Due to the sensitive nature of these logs, read-only roles (such as Zero Trust Read Only) do not have access. :::

CLI

The cloudflared daemon can stream logs from any tunnel in your account to the local command line. cloudflared must be installed on both your local machine and the origin server.

Filter logs

<Render file="tunnel/logs/filter-logs" product="cloudflare-one" params={{ loglevelURL: "/cloudflare-one/networks/connectors/cloudflare-tunnel/configure-tunnels/run-parameters/#loglevel", }} />

View logs for a replica

If you are running multiple cloudflared instances for the same tunnel (also known as replicas), you must specify an individual instance to stream logs from:

  1. In the Cloudflare dashboard, go to Networking > Tunnels and select your tunnel.

  2. Find the Connector ID for the cloudflared instance you want to view.

  3. Specify the Connector ID in cloudflared tail:

    cloudflared tail --connector-id <CONNECTOR ID> <UUID>
    

Performance considerations

  • The logging session will only be held open for one hour. All logging systems introduce some level of performance overhead, and this limit helps prevent long term impact to your tunnel's end-to-end latencies.
  • When streaming logs for a high throughput tunnel, Cloudflare intentionally prioritizes service stability over log delivery. To reduce the number of dropped logs, try requesting fewer logs. To ensure that you are seeing all logs, view logs on the server instead of streaming the logs remotely.

Network session logs

<Render file="tunnel/logs/network-session-logs" product="cloudflare-one" params={{ tailURL: "#view-logs-for-a-replica", }} />