Inside a Logging Service 00:00:01 Carry structured events to the index A buyer's payment failed. Login wrote one line, orders wrote another, and a gateway wrote a third. Thousands of unrelated customers arrived between those timestamps. How can an engineer find the lines that belong to this one purchase? Login: user logged in, info. Orders: payment failed, error. API: rate limit approaching, warning. Each line has a time, a level and an id. An agent such as Fluentd or Filebeat reads the file on its machine and sends batches. Ten thousand lines a second wait here in order. Bursts and outages behind it do not matter to the services. Words and fields go into the index, split over shards. Kibana or Grafana sends the question to the index. A rule counts errors. Too many, and a person is called. Assign fields for service, time, severity and correlation where they have consistent meaning. Avoid recording credentials or sensitive customer payloads simply because the collector can accept arbitrary text. 00:01:14 Search a posting list How the index answers without reading all lines. They come from three services. The word failed is in lines 1 and 2. Each word has its list. One entry is read: lines 1 and 2. Lists 1, 3 and 1, 2 have only line 1 in common. An index can find candidate log records through shared terms or structured fields. Correlation identifiers distinguish one affected request from thousands of otherwise identical timeout messages. 00:01:47 The index disappears temporarily Four hours without the index, at 50 MB a second. The queue has room for 1,440 GB before copies. The queue is nearly empty. The processor keeps its position and waits. 50 MB x 14,400 s equals 720 GB. Half the space is used: time to hurry. The processor can do 150 MB a second, 100 more than arrive: 720 GB take 2 hours. Some lines came twice. Their ids made that harmless. A buffer can preserve a bounded interval of logs while indexing is unavailable. Plan what happens when that buffer fills and recognize duplicates if delivery resumes by replaying acknowledged or uncertain batches. 00:02:38 Retention changes with age From fast disks to object storage to nothing. The last two days. Most questions are about now. Segments are merged and nobody writes any more. In object storage. A search takes longer. Deleting on purpose saves money and protects people. Recent searchable data can remain on fast storage while older material moves to less expensive tiers under the relevant retention and access policy. A usable restore test matters if operators rely on a cold archive. 00:03:11 Trace one request across four services The request enters and gets the id abc-123. Same trace, new span. Still the same trace. Called at 120 ms. Four lines of four services, and the last one says timeout. Carry the correlation identifier through the actual network boundary, including deferred work where appropriate. Clock skew and retries mean textual timestamps alone may not establish the causal order of events. 00:03:43 A debug flag floods the collector Somebody turns on debug in one service. It writes 20 times more. Orders writes 1 MB a second, all others 5. Orders now writes 20 MB a second. Without a limit the queue would get 25 instead of 6. The limit for each service is 3 MB a second. Seventeen are dropped, debug lines first, and counted. Dropped lines raise a ticket for the orders team. They turn debug off. Protect important operational evidence when debug volume rises. Count dropped events, give a team ownership of the limit and reduce the source volume; otherwise a silent logging outage can resemble a mysteriously healthy system. A durable shared pipeline makes logs searchable. Correlation, retention and backpressure make them usable during the very failure an engineer is investigating.