Günlük Toplama ve Saklama Stratejileri
Birçok hizmetten gelen günlükleri merkezileştirmeyi, örnekleme ve saklama katmanlarıyla maliyetleri denetlemeyi ve olaylar sırasında toplanmış günlükleri etkili biçimde sorgulamayı öğrenin.
Günlük Toplama ve Saklama Stratejileri, CoddyKit'te ücretsiz bir Production Debugging & Incident Response Playbook dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Production Debugging & Incident Response Playbook öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Production Debugging & Incident Response Playbook kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Logs Scattered Are Logs Lost
A single service's logs are easy to read. But modern systems have dozens of services across many hosts. Without aggregation, debugging means SSHing into machines one by one, far too slow during an incident.
What Log Aggregation Does
A log aggregation pipeline collects, ships, indexes, and stores logs from every source into one searchable place. You query once and see the whole system.
The Collection Pipeline
Agents on each host tail log files and forward them to a central store. Common stacks pair a shipper with an indexed backend.
# fluent-bit style: tail -> parse -> ship
[INPUT] Name tail Path /var/log/app/*.log
[OUTPUT] Name es Host logs.internal Index app-logsStructured Logs Aggregate Better
JSON logs index cleanly and let you filter by field. Free-text logs force fragile regex parsing. Structured logging pays off most at aggregation scale.
{"level":"error","service":"checkout","trace_id":"abc123","msg":"payment timeout"}The Cost Problem
Aggregated logs grow fast and storage is expensive. A busy system can generate terabytes a day. Cost control is not optional, it is a core design concern.
Sampling High-Volume Logs
Sampling keeps a representative fraction of high-volume, low-value logs while retaining all errors. You preserve signal and slash cost.
if (level === 'error' || Math.random() < 0.05) {
ship(logLine);
}Retention Tiers
Not all logs need the same lifespan. Use tiers:
- Hot (fast, searchable): 7 days
- Warm (slower, cheaper): 30 days
- Cold (archive): 1 year
Move data down tiers as it ages.
Querying During an Incident
The payoff is fast, cross-service queries. Filter by service, level, and trace ID to follow a request across the whole system in seconds.
service:checkout AND level:error AND trace_id:abc123Compliance and PII
Logs may carry personal data. Scrub or mask PII before storage, and align retention with regulations like GDPR, which may require deleting data after a set period.
Alerting on Log Patterns
Aggregated logs feed alerting: a spike in error-level lines or a specific message pattern can trigger a page before users notice. Logs become a detection signal, not just a forensic record.
Avoiding the Single Point of Failure
The aggregation pipeline itself can fail. Buffer logs locally when the backend is unreachable, and monitor the pipeline's own health, so you are not blind during the very incident you need logs for.
Quick Check
Test your understanding of log aggregation.
Recap
You learned log aggregation: centralizing logs into one searchable store, why structured logs aggregate better, controlling cost with sampling and retention tiers, fast cross-service querying during incidents, handling PII/compliance, and alerting on log patterns.
Sıkça Sorulan Sorular
“Günlük Toplama ve Saklama Stratejileri” dersi ücretsiz mi?
Evet — “Günlük Toplama ve Saklama Stratejileri” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Production Debugging & Incident Response Playbook kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Production Debugging & Incident Response Playbook kursu toplamda 4 dersten oluşur.
“Günlük Toplama ve Saklama Stratejileri” dersinde ne öğreneceğim?
Birçok hizmetten gelen günlükleri merkezileştirmeyi, örnekleme ve saklama katmanlarıyla maliyetleri denetlemeyi ve olaylar sırasında toplanmış günlükleri etkili biçimde sorgulamayı öğrenin. Production Debugging & Incident Response Playbook ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Production Debugging & Incident Response Playbook öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Production Debugging & Incident Response Playbook, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.
“Günlük Toplama ve Saklama Stratejileri” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Production Debugging & Incident Response Playbook dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Production Debugging & Incident Response Playbook dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Yapılandırılmış Günlük Kaydı için En İyi Uygulamalar
- Ölçümler, Gösterge Tabloları ve Gözlemlenebilirlik
- Akıllı Uyarı Stratejileri Tasarlama
- Günlük Toplama ve Saklama Stratejileri