Logging Fundamentals
Logging records events from applications, operating systems, and devices. Those records help you understand what happened, investigate failures, and detect security-relevant activity.
itObservability and performance | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Logging Fundamentals
A log is a record of an event, which is less mystical than it sounds and more useful than a folder full of apologetic text files. A completed request, failed sign-in, or configuration change happens; a source writes down selected evidence; later, someone asks the evidence what occurred. The record is not the event. This distinction matters because a missing line can mean no event, or it can mean a buffer filled, a parser objected, a network wandered away, or a receiver discarded the message. Computers are capable of all of these before lunch.
The main trick is structured logging: put reusable context in named fields instead of burying it in prose. A concise body says what happened. Fields say when, where, how serious, and which operation connects the occurrence to other work. A resource identifies the producing application, host, device, or component. Attributes hold details for that occurrence. Stable field names and value types are the small amount of order that lets a search work across services instead of becoming an archaeological expedition into punctuation.
A record then takes the long route: source, collector, processing, transport, backend, query, retention or deletion. That is the pipeline, and each station can change reliability, cost, or meaning. Severity is useful for routing attention, but it is not an internationally binding truth handed down on a stone tablet. Teams define what their levels mean. Add the failed operation and affected component, or an error label merely announces that somewhere, something has become unhappy.
Logs also do not have to answer every question. A metric summarizes numeric behavior over time. A trace follows a request through components. Logs describe individual events. A trace ID and span ID can connect a record to that request path, but correlation cannot repair a record with no useful timestamp, source, body, or attributes. Nor should a log become a souvenir shop for passwords, access tokens, encryption keys, session identifiers, or sensitive personal data. Evidence that creates a new incident has misunderstood its assignment.
Start with the Intro for the model and the pipeline. Use Slides for the relationships among logs, metrics, traces, severity, and retention. Keep the Cheatsheet nearby when choosing fields or testing failure behavior. Then use the practice reference and exercise to make a known test record travel from emission to retrieval. That is where logging stops being writing and starts being evidence.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://opentelemetry.io/docs/concepts/signals/
Supports
- Logs as recordings of events
- Distinctions among logs, metrics, and traces
- https://opentelemetry.io/docs/specs/otel/logs/data-model/
Supports
- Log record timestamps, severity, body, resource, attributes, and trace context
- Structured bodies and mappings from existing log formats
- The 2023 Logs Data Model specification milestone
- https://opentelemetry.io/docs/specs/otel/logs/
Supports
- Collection of application, system, and infrastructure logs
- Log correlation with trace, span, resource, and application context
- https://www.rfc-editor.org/rfc/rfc5424.html
Supports
- Syslog's layered architecture, message format, and structured data
- Truncation, transport, congestion, blocking, and message-loss considerations
- RFC 5424 publication in March 2009
- https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html
Supports
- Security logging purposes, event and field selection, and data exclusions
- Injection resistance, failure testing, access controls, transport protection, retention, and disposal
- The field-note warning against sensitive diagnostic payloads
- https://csrc.nist.gov/pubs/sp/800/92/final
Supports
- Enterprise log management infrastructure and processes
- Policy, planning, implementation, maintenance, and operational use
- https://github.com/sindresorhus/awesome
Supports
- Starting index used to discover topic-relevant awesome lists
- https://github.com/adriannovegil/awesome-observability
Supports
- Curated discovery of Vector, Grafana Loki, Graylog, and GoAccess
- https://vector.dev/docs/introduction/
Supports
- Vector as a pipeline for collecting, transforming, and routing logs
- https://grafana.com/docs/loki/latest/
Supports
- Loki's log aggregation, label model, query path, and beginner starting options
- https://go2docs.graylog.org/current/what_is_graylog/what_is_graylog.htm
Supports
- Graylog collection, parsing, enrichment, search, dashboards, and alerting
- https://goaccess.io/get-started
Supports
- GoAccess terminal, static HTML, and real-time HTML analysis of web access logs
- https://www.rfc-editor.org/rfc/rfc3164
Supports
- RFC 3164 publication in August 2001 and documentation of BSD syslog practice
- https://www.rfc-editor.org/rfc/rfc5425
Supports
- RFC 5425 specification of syslog transport over TLS in March 2006
- https://www.rfc-editor.org/rfc/rfc5426
Supports
- RFC 5426 datagram transport mapping and its delivery limitations
- https://www.elastic.co/search-labs/blog/elasticsearch-history-15-years
Supports
- Elasticsearch's first public release in February 2010
- Elastic's 2013 ELK Stack milestone
- https://github.com/fluent/fluentd
Supports
- Fluentd's 2011 origin and role as an open-source event collector
- https://www.cncf.io/blog/2019/05/21/opentelemetry-merged-project-website-and-contributing-guidelines/
Supports
- OpenTelemetry's formation from OpenCensus and OpenTracing in May 2019
- https://grafana.com/docs/loki/latest/get-started/overview/
Supports
- Loki's label-based index and compressed log chunks
- The field-note tradeoff between stream labels and event detail
- https://docs.splunk.com/Documentation
Supports
- Splunk documentation for indexing, search, and operational analysis
- https://www.elastic.co/observability
Supports
- Elastic Observability as a destination for log analysis
- https://www.datadoghq.com/product/log-management/
Supports
- Datadog Log Management collection, processing, search, and retention capabilities
- https://www.sumologic.com/
Supports
- Sumo Logic as a hosted log-management option
