How does log management work on a modern Linux server?
BeginnerProductionLogs, Limits & High-Traffic Tuning
Answer
Services log to stdout/stderr (captured by journald) or to files under /var/log. journald can forward to rsyslog, which writes classic files (/var/log/syslog, /var/log/messages, auth.log/secure) and can forward remotely. An agent (Fluent Bit, Vector, the CloudWatch agent, Elastic Agent) ships logs to a central store (Loki, Elasticsearch/OpenSearch, CloudWatch, Splunk). logrotate and journald size limits keep local disks from filling.
More on Logs, Limits & High-Traffic Tuning
Why centralize logs instead of reading them on each server?BeginnerWrite a logrotate config for an application log.BeginnerWhat is the difference between `copytruncate` and `create` + postrotate signal?IntermediateLogs rotated but disk usage did not drop. Why?IntermediateHow often does logrotate run, and why does `maxsize` sometimes not trigger in time?IntermediateHow do you limit journald disk usage?Intermediate