Jonatan Matajonmatum.com
conceptsnotesexperimentsessays
© 2026 Jonatan Mata. All rights reserved.v2.1.1
Concepts

Logging Strategies

Practices for implementing effective logging in distributed systems: structured logging, levels, correlation, and centralized aggregation.

seed#logging#structured-logging#elk#cloudwatch#observability#debugging

What it is

Effective logging in distributed systems goes beyond console.log. It requires structure, cross-service correlation, appropriate levels, and centralized aggregation to be useful for debugging and auditing.

Structured Logging

Logs in JSON format instead of plain text:

{"level":"info","msg":"Order created","orderId":"123","userId":"456","traceId":"abc","timestamp":"2026-03-16T10:00:00Z"}

Benefits: efficient search, field filtering, automatic parsing.

Levels

LevelUse
DEBUGDevelopment detail
INFONormal business events
WARNUnexpected non-critical situations
ERRORFailures requiring attention

Correlation

Include traceId and requestId in every log to trace a request across multiple services.

Aggregation tools

  • ELK Stack (Elasticsearch, Logstash, Kibana)
  • Grafana Loki
  • AWS CloudWatch Logs
  • Datadog Logs

Why it matters

Logs are the first diagnostic tool when something fails. Structured logs, with appropriate levels and cross-service correlation, turn hours of debugging into minutes. Unstructured logs are noise that hides the signal.

References

  • Structured Logging — Reference Python library.
  • OpenTelemetry Logs — OpenTelemetry, 2024. Open standard for logs.
  • Elastic Common Schema — Elastic, 2024. Standard schema for structured logs.

Related content

  • Observability

    Ability to understand a system's internal state from its external outputs: logs, metrics, and traces, enabling problem diagnosis without direct system access.

  • Serverless

    Cloud computing model where the provider manages infrastructure automatically, allowing code execution without provisioning or managing servers, paying only for actual usage.

  • Distributed Tracing

    Observability technique tracking requests across multiple services in distributed systems, enabling bottleneck identification and failure diagnosis.

Concepts