
Log
A log is an automatically written list of events that a computer program records during its operation. Each entry usually contains a timestamp, the location within the program, and a brief description of what happened.
A log is a diary that a computer program writes about itself. Whenever something noteworthy happens, the program appends a line to a file. Such a line typically contains the date, the exact time, and a short text. For example: that someone logged in, that a file was saved, or that an error occurred. Nobody types these lines by hand, they are generated automatically during operation. For large services, this results in millions of lines accumulating per day.
What logs reveal after a crash
Software usually runs unobserved. If a service fails at three in the morning, nobody is sitting in front of it watching. The log is then the only source that can still say what happened in the seconds before the failure. This is precisely why developers write logs: not for the normal case, but for the day when something goes wrong.
Logs are also important for security. When someone tries to gain unauthorized access to a system, they leave traces in the logs while doing so. Five hundred failed login attempts within a minute stand out immediately in a log. Many attacks are only discovered afterward, through the analysis of such entries.
A third reason is legal in nature. Banks, hospitals, and government agencies must be able to prove who accessed which data and when. Without complete logs, this proof is impossible. For this reason, such logs often may not be deleted for years.
From individual entry to searchable collection
A single log entry usually has three parts. First, the timestamp, i.e. the exact moment of the event. Then a severity level, usually named with English words: INFO for harmless messages, WARN for anomalies, ERROR for actual errors. Finally, the text describing what happened. Anyone who only wants to see the errors simply filters by the ERROR level.
In the past, logs simply sat as text files on the hard drive of the respective machine. Today, an online service often consists of hundreds of machines working together. Each of them writes its own lines, and the path of a single request runs across several of these machines. That’s why all participants send their entries to a central collection service. There they end up in a database and can be searched together.
A practical problem is the sheer volume. Logs consume storage space, and storage space costs money. For this reason, a retention period is common: entries are automatically deleted after thirty or ninety days. It’s also important to consider what should never be written into a log in the first place. Passwords or credit card numbers in a log would be a serious mistake, since many people within a company are allowed to view logs.
Logs in outages, AI systems, and the browser
When a major service fails, the provider usually publishes a report on the cause afterward. Such analyses are almost always based on logs. Sentences like “at 2:07 PM the timeouts began” can only be reconstructed from logs. Logs are also the central piece of evidence in investigations following data breaches.
In the AI world, logs have an additional role. Chatbot operators log which inputs users send and how long the response takes. These records show where the model fails and serve as a basis for improvements. At the same time, they are a privacy issue, since users often write personal things in such chats. How long a provider stores conversation logs is stated in its privacy policy.
You can even access logs on your own laptop. Every browser has a developer console that displays messages from the visited website. Anyone who opens it sees red error lines and harmless notices side by side. A log should not be confused with a backup: it doesn’t store data for recovery, only reports about events.