Logflare screenshot

Edge Logs for Everyone

tail -f your Cloudflare logs for free!

*** not affiliated with Cloudflare ***

Why?

Because Cloudflare doesn't give you logs unless you're on an Enterprise plan.

Sign up -or- Check out the demo

5 Minute Setup

Just install our Cloudflare Worker and you're good to go!

  
    async function handleRequest(event) {
      const {request} = event;
      const rMeth = request.method
      const rUrl = request.url
      const uAgent = request.headers.get("user-agent")
      const rHost = request.headers.get("host")
      const cfRay = request.headers.get("cf-ray")
      const cIP= request.headers.get("cf-connecting-ip")

      const sourceKey = "YOUR_SOURCE_KEY"
      const apiKey = "YOUR_API_KEY"

      const response = await fetch(request)

      const statusCode = response.status
      const contentLength = response.headers.get("content-legth")

      const logEntry = `${rMeth} | ${statusCode} | ${cIP} | ${cfRay} | ${rUrl} | ${uAgent}`

      const init = {
        method: "POST",
        headers: { "X-API-KEY": apiKey, "Content-Type": "application/json", "User-Agent": `Cloudflare Worker via ${rHost}` },
        body: JSON.stringify({ source: sourceKey, log_entry: logEntry }),
      }

      event.waitUntil(fetch("https://logflare.app/api/logs", init))

      return response
    }

    addEventListener("fetch", event => {
      event.respondWith(handleRequest(event))
    })
  

Features

  • Free
  • Open source
  • Stream logs to your browser
  • Send custom logs via API request
  • Watch log files with the agent
  • 1,000 log entries per source
  • Up to 100 sources per account
  • Logs older than 30 days are deleted
  • Log routing
  • Local time & UTC
  • Public urls for sources