Log file: what it is, where it is stored and how to read logs on Linux and Windows
Checkcraft is a desktop app for checking APIs and logs without code, with a free edition. Download, no sign-up →
A log file is a journal where a program records what it did: start-up, requests, warnings and errors, each entry with a timestamp. When something breaks, the log is the first place to look. Below is where logs live on Linux, Windows and in popular programs, how to open them and how to find an error quickly.
What goes into a log
Each line usually has a timestamp, a level and a message: INFO for normal events, WARN for suspicious ones, ERROR for failures. Service logs often include a traceId, which collects all entries of one operation across services.
How to find an error in a log
Do not read the whole log. Filter ERROR and the time of the problem first, then look at a few lines before the first error: the cause is usually there, not in the last line. If there is a traceId, search by it directly.

Can logs be deleted
Old logs can be deleted, but better set up rotation: logrotate on Linux, and systemd limits the journal size itself. Before deleting, keep logs from the period with problems: you will need them for analysis.
Where logs live
| What | Where to look |
|---|---|
| Linux, system | /var/log/syslog (Debian, Ubuntu) or /var/log/messages (RHEL, CentOS) |
| Linux, logins and sudo | /var/log/auth.log or /var/log/secure |
| Linux, systemd services | systemd journal: journalctl -u service_name |
| nginx | /var/log/nginx/access.log and error.log |
| Apache | /var/log/apache2/ or /var/log/httpd/ |
| PostgreSQL | log directory in the cluster data or /var/log/postgresql/ |
| Docker | docker logs container_name |
| Windows, system | Event Viewer (eventvwr.msc): System, Application, Security logs |
| Windows apps | usually %LOCALAPPDATA%, %APPDATA% or %PROGRAMDATA% in the app folder |
Exact paths depend on the distribution and settings; if a file is missing, check the program config, usually a log, logfile or log_dir option.

Anatomy of a log line
2026-11-24T14:03:12.481Z ERROR payments traceId=4bf92f35 order=5004 card_declined: Payment declined by bank
└── время ──────────────┘ └уровень┘ └сервис┘ └─ идентификатор ─┘ └──────── сообщение ────────────────────┘The stricter the format, the easier the search. Many services log JSON, one line per event, which is easy to parse and ship to Kibana or Loki.
Commands to read logs
# последние 100 строк и дальше в реальном времени
tail -n 100 -f /var/log/nginx/error.log
# только ошибки
grep -i "error" /var/log/syslog | tail -n 50
# все записи одного запроса по traceId
grep "4bf92f35" /var/log/app/*.log
# журнал сервиса за час, только ошибки
journalctl -u payments --since "1 hour ago" -p err
# Windows PowerShell: последние ошибки журнала Приложение
Get-WinEvent -LogName Application -MaxEvents 50 | Where-Object LevelDisplayName -eq "Ошибка"With more than one server, SSH into each is slow; collect logs centrally. See log analysis tools.
All guides in the logs section
- Log analysis tools: 9 options and how to choose in 2026
- Log monitoring: how to get alerts about errors in logs
- Log analysis without programming: where to start
- Search logs by traceId online: find every line of a request and its errors
- traceId: what it is and how to find a request in the logs
- Find request logs by traceId in Kibana
- Automate API and log checks with Kibana
- An API client that checks Kibana logs and the database, not just the response
- How to give an AI agent access to logs without handing over SSH or passwords
Frequently asked questions
What is a log file?
A journal where a program records its actions and errors with timestamps.
Where are logs on Linux?
/var/log: syslog or messages, auth.log or secure, app subfolders; journalctl for systemd.
Where are logs on Windows?
Event Viewer (eventvwr.msc) and app folders under %LOCALAPPDATA%, %APPDATA%, %PROGRAMDATA%.
Can I delete log files?
Old ones yes; better configure rotation with logrotate or systemd limits.
Repeat this on your own API
Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.
Download FreeDownload and first runNo sign-up or email needed, the archive is ready in a couple of minutes. See the edition limits.
Start with the linked example and compare its result with your own test requirement.