Access Logs: Retention, Logpush to R2 and Product Decisions
Logs do more than debug: forensics, cost attribution, product decisions, compliance. Current Cloudflare retention rules and a Logpush-to-R2 setup.
Short answer: Access logs carry six layers of value: debugging, security forensics, cost attribution, product decisions, capacity planning, and compliance. The first three matter when something breaks; the last three deserve daily use — and most teams stop at layer two. Cloudflare’s rules changed materially in October 2026: analytics data is now retained for at least 30 days on every plan, and Logpush — previously Enterprise-only — is open to all plans with usage-based pricing (exports to internal destinations like R2 include 25 GB per month free, then $0.03 per GB). The standard setup: stream logs to R2 via Logpush (S3-compatible, zero egress fees), tier your retention, keep the fields that matter — BotScore, JA4, ASN, rate-limit hits — and let forensics, billing and product analysis share one dataset.
Logs are worth more than debugging: six layers
Think of log value as a ladder. The higher you climb, the further the audience moves from operations toward the business:
| Layer | Value | Who uses it |
|---|---|---|
| 1. Debugging | Locate failures: edge, gateway or application | Ops, SRE |
| 2. Forensics | Reconstruct credential stuffing, API abuse, free-tier farming; evidence in billing disputes | Security |
| 3. Accounting | Attribute call costs per tenant or key; protect free tiers | Finance, growth |
| 4. Product decisions | Read what users want out of the logs (below) | Product |
| 5. Capacity & experience | Traffic patterns, cache hits, autoscaling inputs | Eng, marketing |
| 6. Compliance & trust | Retention obligations, QoS evidence for B2B customers | Legal, leadership |
Layers one to three are read after incidents; four to six should be read weekly. The tell that a team actually uses its logs is layer four: whether logs are an input to the product meeting.
What Cloudflare logging looks like now: the October 2026 rules
Until October 2026, long-term log retention meant either an Enterprise contract or manual exports. Since October 2, the picture is different:
| Capability | Current state (from October 2026) |
|---|---|
| Analytics retention | At least 30 days on every plan, with 30-day query windows (previously 24 hours to 8 days on Free and Pro) |
| Logpush exports | Open to all plans, no longer Enterprise-only; usage-based pricing from December 1 |
| Internal destinations | R2 and Pipelines: 25 GB per month included, then $0.03 per GB |
| External destinations | S3, SIEM and others: 25 GB per month included, then $0.10 per GB |
| Transformers | Available on all plans for filtering, sampling and redaction before delivery; 1 GB input included, then $0.04 per GB |
| Log Explorer retention | First 10 GB per month free, 30-day standard retention, longer retention available by contract |
Two rules shape the planning: first, 30-day analytics retention means post-incident review works on every plan — you no longer upgrade just to look back a month. Second, internal destinations cost a third of external ones, so where you land the logs decides the long-term bill.
Where AI platform logs live today
Before deciding where logs should go, look at where they usually are now. Five routes cover most AI platforms:
| Route | Typical setup | Main pain |
|---|---|---|
| Local disk | access.log and JSON lines on the app server | Disk fills and logging stops; server loss means log loss; no central query; retention capped by disk size |
| Self-hosted ELK / Loki | Fluentd or Vector feeding an Elasticsearch cluster | Strong queries, but the cluster is memory-hungry and indexes grow with volume; it needs dedicated care, and query bursts compete with production |
| Cloud logging services | CloudWatch, GCP Cloud Logging, Alibaba Cloud SLS | Zero ops, but ingestion is pricey: CloudWatch bills $0.50 per GB ingested — more than ten times the Logpush-to-R2 rate — and queries and exports bill separately |
| Observability SaaS | Datadog, Splunk | The best experience, but ingestion starts at $0.10 per GB with long-term retention billed on top; full access logs blow up the bill, so teams sample |
| Self-built pipeline to S3 | Vector pipeline plus S3 and Athena | Storage is cheap, but the collection pipeline is yours to build and keep alive; S3 egress and Athena per-scan fees surface on every retro-query |
All five solve “how to store and query logs” yet share one blind spot: edge signals. Whether logs sit on disk, in Elasticsearch or in Datadog, fields like BotScore, JA4 fingerprints and account abuse events are simply not there — you either bolt on a fingerprinting library or go without. On the Cloudflare route those fields exist at generation time: one Logpush job streams everything out, the collection layer (agents, Kafka, ingestion clusters) disappears entirely, and Transformers filters and redacts inside the pipeline. The difference is not only storage cost — the collection layer and the signals come built in, not bolted on.
Where to store them: why most teams start with R2
There are three destination types: Cloudflare’s own R2, external object storage (S3 and friends), and SIEMs or warehouses. Most teams start with R2 for three reasons:
- Zero egress fees. Reading logs out of R2 costs nothing in egress. Logs are write-heavy, read-rarely, and when you do read, you read a lot — egress charges compound quietly.
- The internal rate. Logpush to R2 bills at $0.03 per GB, a third of the $0.10 external rate.
- S3 compatibility. Existing scripts and BI connectors keep working; no lock-in.
A SIEM fits security teams that already run one for real-time alerting; external object storage fits companies with an existing data lake. Without either, R2 is the cheapest start.
The fields AI platforms should keep
Pushing every field multiplies cost and noise. For generative-AI products, this set covers both forensics and business analysis:
- Identity and origin: RayID (the key that joins everything), timestamp, path, client ASN and country.
- Automation signals: BotScore, JA4/JA3 fingerprints, User Agent — the only way to tell scripted traffic from humans after the fact.
- Security actions: firewall action, rate-limit hits, managed challenge outcomes — which rule handled each request, and when.
- Account dimension: the Account Abuse Protection Events dataset (added August 2026) carries authentication method and status, and a fraud email risk score — built for post-hoc review of signup and login abuse.
Your application’s own billing and generation logs sit outside Cloudflare’s view. The edge log’s job is to testify what the call looked like from outside: under the same RayID, was it a human or a script, which defenses it passed, and what the edge decided at the time.
Four ways logs feed product decisions
This is the layer most teams never reach, and it is where the value compounds:
- Failure funnel. Conversion per step: request → validation → generation completed. Whether failures cluster in parameter validation, content-moderation false positives or inference timeouts determines a very different roadmap — logs are a direct input to sprint planning.
- Parameter distributions. The spread of resolutions, steps and batch sizes users actually send. Move defaults toward the mode and wasted calls drop; during a model grey release, compare call volume and success rates old versus new before going wide.
- Repeat requests and caching. A high share of repeated popular results means they belong in a cache. For image generation, one cache hit saves one full inference — cost and latency improve together.
- Time and geography. Traffic rhythms drive the GPU autoscaling curve, node placement and campaign scheduling; failure rates split by country surface regional degradation early.
The common thread: nobody builds logging in order to do product analysis. You read differently the logs you already generate. What is missing is not data — it is retention. Analysis wants a month of history; the console gives you 30 days; the real archive lives in your own storage.
Retention policy: tiers, periods, compliance
A workable, cheap starting point is three tiers:
- Hot (online, 30 days): all request logs for debugging and short-window analysis — Log Explorer or standard R2 storage.
- Warm (queryable, 6 months): security events, account abuse, billing-relevant records. Abuse and credential-stuffing investigations look back in months.
- Cold (archive, as needed): redacted, sampled logs and compliance-mandated records, moved to infrequent access.
Compliance sets the floor, not preference. Network logs must be retained for at least six months under China’s cybersecurity rules; AI-generated content requires traceable records; European users bring GDPR storage-limitation and deletion duties. That is exactly why redaction belongs in the pipeline, not in a retrofit at audit time.
The cost, worked out
Estimate formula: monthly log volume ≈ monthly requests × per-record size. HTTP request logs run 1 to 2 KB depending on field count; budget 1 KB with a trimmed field set.
At 100 million requests per month and 1 KB average, that is roughly 100 GB:
- Logpush to R2: 25 GB included + 75 GB × $0.03 ≈ $2.3
- R2 standard storage: 100 GB × $0.015/GB-month ≈ $1.5/month (growing linearly with accumulation)
In other words, permanently retaining the full edge-log stream of a mid-sized AI platform costs single-digit dollars per month. Against what the archive supports — forensics, billing, product decisions — the decision does not take long. At higher volume, trim fields and sample in Transformers first; cost falls linearly with volume.
What Enterprise adds on top of logs
The R2-first path above works on every plan — using the included allowances well is step one. As scale grows, Enterprise adds on this line:
- Contract pricing and terms: existing Enterprise contracts keep current Logpush pricing through renewal; heavy users negotiate volume terms.
- Higher included quotas: under the observability subscription, paid and Enterprise plans include 50 GB of ingestion and 10 GB-month of storage per cycle, with up to one year of log and trace retention coming.
- Custom retention: Log Explorer retention periods are configurable by contract, for industry audit requirements.
- An account team: field design, Transformers rules and multi-region exports are one-time builds — done with someone, not alone.
Advanced detection signals from Bot Management — scores, fingerprints, account abuse events — also live on the Enterprise side. Once the pipeline exists, those are the fields that make forensics genuinely useful.
Rollout order and common failures
Run in this order and you are live within a week:
- Create one Logpush job to R2 with a minimal field set: RayID, timestamp, path, status, BotScore, JA4, ASN, firewall action.
- Partition by
/{DATE}, then run 24 hours and reconcile volume against request counts. - Add Transformers: drop unused fields, redact personal data such as IPs.
- Connect BI or SIEM, and turn layer four (failure funnel, parameter distribution) into a weekly report.
Four failure patterns. Living in the console only means evidence evaporates after 30 days. Pushing every field raises cost and noise together. Skipping partitions makes every retro-query scan the whole bucket. Deferring redaction means the whole pipeline gets reworked at audit time.
FAQ
How long does Cloudflare retain logs by default? Analytics data is retained for at least 30 days on every plan (since October 2026; previously 24 hours to 8 days on Free and Pro). Long-term retention of raw request logs relies on Logpush into your own storage, where the TTL is entirely yours — R2 has no forced expiry.
Does Logpush still require Enterprise? No. Since October 2026 Logpush is open to all plans with usage-based pricing. Exports to internal destinations such as R2 include 25 GB per month free, then $0.03 per GB. External destinations such as S3 or a SIEM bill $0.10 per GB beyond the included 25 GB.
Where should logs be stored? Most teams start with R2: S3-compatible, zero egress fees on retrieval, and the internal export rate — a third of the external one. Teams with an existing data lake or SIEM plug into that; everyone else saves money starting on R2.
How long should we retain logs for compliance? The floor is set by jurisdiction and industry: China’s cybersecurity rules require at least six months of network logs, AI-generated content has its own record-keeping requirements, and European users bring GDPR storage-limitation and deletion duties. The common pattern is tiering: 30 days hot online, security and billing records queryable for 6 months, cold data redacted and archived.
The volume is too large — what then? Three levers, in order: filter and sample in Transformers (1 GB of input included monthly), push only the fields the business uses, and tier hot from cold storage. Most teams need the long tail of security and billing events, not every request.
We already run ELK or a cloud logging service — is Logpush to R2 still needed? They are not mutually exclusive: keep ELK or your SIEM as the downstream query layer, and let Logpush land a full copy of the raw logs in cheap object storage. Two signals say it is time to switch: sampling forced by cost, or retention capped by ingestion pricing (CloudWatch bills $0.50 per GB ingested; Datadog charges separately for long-term retention). Route full request logs through Logpush to R2 instead — $0.03 per GB, 25 GB included monthly, zero egress — and the lookback window is back while your existing query layer stays untouched.
What does Enterprise add on logs? Higher included quotas (50 GB of ingestion monthly), contract pricing and terms, custom Log Explorer retention periods for audit needs, and an account team for the one-time field and pipeline design. Bot Management’s advanced signals also live on the Enterprise side — the most valuable forensics fields once the pipeline exists.
Related reading
- Managing API Costs and Abnormal Traffic in AI SaaS
- How to Prevent API Abuse in AI SaaS
- Hit by Credential Stuffing? How to Defend Your Login Endpoint
- When a DDoS Attack Takes You Down: Protecting Business Continuity
Logs are the third thread — after security and cost — that quietly decides the business. If yours still live in the console for 30 days and vanish, or you want the six-layer pipeline above built out, talk to us — we can draft a concrete retention and export plan around your request volume and compliance needs.
Run the same check on your domain
Enter a domain and see its DNS hosting, mail authentication and Cloudflare status in 30 seconds. Free, public records only.
Public DNS records only. No intrusive scanning. · Used only to send this diagnosis — no marketing blasts.
Sources
Official Cloudflare documentation. Where this article mentions availability, quotas or limits, these pages are the source of truth. Cloudflare features change over time — confirm what is visible in your dashboard before committing to a design.