Logs
Timestamped records of what a program did, written as it runs and shipped somewhere you can search them.
11 technologies on this page ↓How it works
A log is a stream of events, each a line with a timestamp, a severity level and a message, such as 2026-10-06T09:14:03Z ERROR payment declined order=9124. The program writes them as things happen. In containers and on platforms such as Kubernetes, Lambda or Cloud Run, the convention is to write to stdout and stderr and let the platform capture the stream; Kubernetes keeps each container’s output in files on the node and rotates them at 10 MiB by default. An agent such as Fluent Bit, Vector or the OpenTelemetry Collector reads those streams, adds metadata (pod, host, service), filters out what you don’t want and ships the rest to a central store: CloudWatch Logs, Cloud Logging, Azure Monitor Logs, Loki, Elasticsearch, OpenSearch or a ClickHouse-based stack such as ClickStack. There you search every machine at once. Levels decide how much detail you keep: most services log INFO and above in production and turn DEBUG on only while chasing a bug. The bill follows volume. Hosted stores charge per GB ingested (CloudWatch Logs’ pricing examples and Cloud Logging’s price list both use $0.50 per GB, Cloud Logging after a free 50 GiB per project each month) plus storage, so retention periods, dropping noisy lines and sampling repetitive ones matter as much as what you log.
A ship’s logbook. The crew writes down each event with the time as it happens. Nobody reads it while the sea is calm, but after a storm it’s the first thing everyone opens.
Reach for it when
- Knowing exactly what happened to one request, job or user, with the details
- Errors and their context: the inputs, the IDs and the branch the code took
- Audit trails: who changed what, and when
- Questions you couldn’t predict a metric for in advance
Think twice when
- Counting things over time; a metric is far cheaper than counting log lines
- Following one request across many services by hand; put a trace or correlation ID in every line
- Passwords, tokens, card numbers and personal data; mask them before they leave the process
- DEBUG on everything in production; volume, and the bill, grow with traffic
A real example
A checkout service writes about 200 log lines a second at INFO, around 1.5 KB each. That’s roughly 26 GB a day, close to 780 GB a month, or about $390 a month to ingest at $0.50 per GB before storage. After an incident someone leaves DEBUG on and the volume jumps, say, tenfold. A filter in the node’s Fluent Bit that drops DEBUG in production, and a 30-day retention period on the log group (CloudWatch keeps logs forever unless you set one), bring the bill back down.
More on logs
Narrower ideas that build on this one.
Technologies
Specific products, and what each does differently.
| Open source | Cloud Native Computing Foundation | Apache 2.0 | 2026-10-06 | |
| Open source | Elastic N.V. | Apache 2.0 (core and plugins); `x-pack` code under the Elastic License, included in the default download but not in the `-oss` builds | 2026-10-06 | |
| Commercial product | Cloudflare, Inc. | Proprietary | 2026-10-12 |
Also used for logs
Products of other kinds that are often used this way, grouped by what they are.
Amazon CloudWatchAWSAWS’s built-in monitoring service: metrics from every AWS service, logs, alarms and dashboards, and now traces, OpenTelemetry and PromQL, billed per metric, per GB and per alarm.| Search indexes | Commercial product | Elastic N.V. | Source code: AGPLv3, SSPL 1.0 or Elastic License 2.0, your choice, except paid features under `x-pack`, which are Elastic License 2.0 only. Default downloads: Elastic License 2.0. Apache 2.0 up to 7.10.2 | 2026-10-06 | |
| Search indexes | Open source | OpenSearch Software Foundation | Apache 2.0 | 2026-10-06 | |
Amazon CloudWatch | Observability | Managed service on AWS | Amazon Web Services | Proprietary | 2026-10-06 |
| Observability | Commercial product | Better Stack, Inc. | Proprietary (the Better Stack collector is Apache 2.0) | 2026-10-05 | |
| Observability | Open source | ClickHouse, Inc. | MIT (HyperDX UI, API and the ClickStack collector build); Apache 2.0 (ClickHouse and the upstream OpenTelemetry Collector); self-hosted app state in MongoDB, which is SSPL; Managed ClickStack is a proprietary ClickHouse Cloud service | 2026-10-06 | |
| Observability | Commercial product | Datadog, Inc. | Proprietary (the Datadog Agent is Apache 2.0) | 2026-10-05 | |
| Observability | Open source | Cloud Native Computing Foundation | Apache 2.0 | 2026-10-05 | |
| Error tracking | Commercial product | Functional Software, Inc. (Sentry) | FSL-1.1-Apache-2.0: source-available, each release becomes Apache 2.0 after two years (BSL 1.1 from 2019, BSD 3-Clause before); SDKs are MIT | 2026-10-05 |
What each provider calls it
- AWS
- CloudWatch Logs (Logs Insights for queries, Live Tail)
- Google Cloud
- Cloud Logging (Log Router and log buckets)
- Azure
- Azure Monitor Logs (Log Analytics workspaces, queried with KQL)
- Open source & others
- Stores: Grafana Loki, Elasticsearch, OpenSearch, ClickStack; agents: Fluent Bit, Fluentd, Vector, Logstash, OpenTelemetry Collector; hosted: Datadog, Better Stack
Log levels#
Syslog’s eight severities and the six ranges in OpenTelemetry’s log data model, side by side. Most logging libraries use names close to the left column.
| Level | Syslog severity (RFC 5424) | OpenTelemetry SeverityNumber | Use it for |
|---|---|---|---|
| TRACE | none | 1 to 4 | Step-by-step detail; off almost everywhere |
| DEBUG | 7 Debug | 5 to 8 | Detail for developers; off in production unless you’re chasing a bug |
| INFO | 6 Informational, 5 Notice | 9 to 12 | Normal events worth keeping: started, order placed, job finished |
| WARN | 4 Warning | 13 to 16 | Something odd the code handled: a retry, a fallback, a slow call |
| ERROR | 3 Error | 17 to 20 | A request or job failed |
| FATAL | 2 Critical, 1 Alert, 0 Emergency | 21 to 24 | The process or system can’t go on |
- Rows line up by meaning; the two scales don’t map one to one. In syslog a lower number is more severe, in OpenTelemetry a higher one.
In code · bash
# the container writes to stdout; the platform keeps the stream
kubectl logs deployment/api --since=10m --follow
# the same lines after an agent shipped them to CloudWatch Logs
aws logs tail /ecs/api --since 10m --follow --filter-pattern '{ $.level = "error" }'
# keep 30 days instead of forever
aws logs put-retention-policy --log-group-name /ecs/api --retention-in-days 30Often confused with
Where it came from2001–2022
Programs have always printed what they were doing, but on early Unix each daemon kept its own files in its own format. In the 1980s Eric Allman, while building Sendmail at Berkeley, wrote syslog: a program sends a short message tagged with a facility (which part of the system is talking) and a severity, and a syslog daemon writes it locally or relays it to a central host. It became the standard on nearly every Unix-like system and network device. It was only written down in 2001, when RFC 3164 described the BSD syslog protocol as it had been observed in the wild; RFC 5424 replaced it in 2009 with a stricter format, structured data fields and a required TLS transport.
Cloud platforms changed where logs live. When servers come and go, files on their disks go with them. Heroku’s Twelve-Factor App, presented by Adam Wiggins around 2011, stated the new rule: an app never manages log files; each process writes an unbuffered event stream to stdout, and the platform collects, routes and archives it. Agents grew up to do that routing, among them Logstash, Fluentd and, from 2014, Fluent Bit, a lightweight sibling of Fluentd built at Treasure Data for small devices. AWS added CloudWatch Logs the same year. In 2018 Grafana Labs introduced Loki, which borrowed Prometheus’ labels to make storing logs cheap.
The latest shift is a shared model. OpenTelemetry declared its log data model stable in 2022, so a log record has the same fields (timestamp, severity, body, attributes, and the trace and span IDs of the request it belongs to) whatever language or agent produced it.
Why it’s built this way
- A severity on every message
- Syslog tagged each message with one of eight severities, from Emergency to Debug. One setting could then decide what to keep and where to send it, without changing the program.
- Write to stdout and let the platform route it
- If the app doesn’t know or care where its logs go, the same code works on a laptop, where you watch the stream in a terminal, and in production, where it’s collated and sent to an indexing system.
- Index labels, not the text
- Loki indexes only a small set of labels per log stream and keeps the lines themselves compressed in object storage. Its authors chose this so that logs would be cheap enough that nobody is asked to log less, and so that the same labels as Prometheus metrics lead from an alert to the right logs.
Timeline
- 2001
RFC 3164 documents the BSD syslog protocol as observed
- 2009
RFC 5424 standardises syslog and obsoletes RFC 3164
- 2011
The Twelve-Factor App: treat logs as event streams
- 2014
Fluent Bit begins at Treasure Data; CloudWatch Logs launches in July
- 2018
Grafana Labs introduces Loki
- 2022
OpenTelemetry declares its log data model stable
- Internet Hall of Fame: Eric Allman (created syslog)
- Wikipedia: Syslog (developed in the 1980s by Eric Allman as part of Sendmail)
- RFC 3164: The BSD syslog Protocol (Informational, August 2001)
- RFC 5424: The Syslog Protocol (Standards Track, March 2009)
- The Twelve-Factor App: XI. Logs
- Wikipedia: Twelve-Factor App methodology (Adam Wiggins, circa 2011)
- Fluent Bit manual: What is Fluent Bit? (history, 2014)
- AWS News Blog: Store and monitor OS and application log files with Amazon CloudWatch (July 2014)
- Grafana Labs blog: Loki, Prometheus-inspired open source logging for cloud natives (Dec 2018)
- OpenTelemetry specification PR #2387: Declare Log Data Model Stable (merged March 2022)
Sources19
- Kubernetes docs: Logging architecture (stdout, node agents, 10 MiB rotation)
- Fluent Bit manual: What is Fluent Bit?
- Vector on GitHub: a high-performance observability data pipeline
- OpenTelemetry docs: Collector
- OpenTelemetry specification: Logs data model (severity numbers, trace context fields)
- RFC 5424: The Syslog Protocol, severity values
- AWS docs: Working with log groups and log streams (retention is indefinite by default)
- Amazon CloudWatch pricing (log ingestion examples at $0.50 per GB, Live Tail)
- AWS docs: Filter pattern syntax for CloudWatch Logs (JSON filters)
- AWS CLI reference: aws logs tail
- AWS CLI reference: aws logs put-retention-policy
- Kubernetes docs: kubectl logs
- Google Cloud: Observability pricing (Cloud Logging $0.50/GiB, first 50 GiB per project free)
- Google Cloud docs: Configure log buckets (30-day default retention)
- Google Cloud docs: Routing and storage overview (Log Router, _Required and _Default sinks)
- Microsoft Learn: Azure Monitor Logs overview (Log Analytics workspaces, KQL)
- Grafana Loki docs: Overview (indexes labels, not log contents)
- ClickHouse docs: ClickStack architecture
- OWASP Logging Cheat Sheet (data to exclude, log injection)