"매 log 는 system 의 외부 관측 가능성(observability)의 세 기둥 중 하나로 매 metric/trace 의 sibling 이며 매 high-cardinality narrative event 의 sink". 매 2026 의 표준은 structured JSON + OpenTelemetry semantic conventions + 5-level severity + sampling/aggregation pipeline.
매 핵심
매 Three pillars of observability
Metrics: 매 numeric, low-cardinality, aggregable. (Prometheus, OTLP metrics)
Logs: 매 textual, high-cardinality, event-narrative.
Traces: 매 request-scoped causal chain across services.
매 Log levels (RFC 5424 + practice)
FATAL/EMERGENCY: 매 process death imminent.
ERROR: 매 user-facing failure or unexpected condition.
WARN: 매 degraded state, fallback engaged.
INFO: 매 lifecycle events (start, stop, deploy).
DEBUG: 매 development troubleshooting.
TRACE: 매 fine-grained step-level (rarely on in prod).
매 Structured logging (2026 default)
JSON line format: 매 1 event = 1 line, machine-parseable.
언제: 매 log schema design, redaction rule draft, log-based alert query, log clustering for unknown patterns, postmortem timeline reconstruction.
언제 X: 매 raw log content with PII (privacy), 매 customer-attributable narrative without aggregation.
❌ 안티패턴
String concat logging: 매 "user " + id + " did " + x → grep-only, no fields.
Log everything DEBUG in prod: 매 cost 폭증 + signal-to-noise 0.
PII in logs: 매 password/SSN/credit card untouched → instant breach.
No retention policy: 매 7-year retention for trivial DEBUG → storage runaway.
Logs as primary metric: 매 count error logs → use metrics; logs are narrative.
Blocking sync logging: 매 disk fsync per log → throughput 폭락. Use async batch.
🧪 검증 / 중복
Verified (OpenTelemetry Logs spec v1.31, Google SRE Book Ch.6 "Monitoring Distributed Systems", RFC 5424).