# Access Log

> A file with a line for each visit to a web server.

**Field:** Infrastructure  
**Category:** Web Serving & Nginx  
**Also known as:** access.log, Web Server Log, Request Log

## Think of it like

It is like a visitors' book at a front desk. Everyone who comes in writes their name and the time.

## Definition

An access log is a file where a web server writes one line for each request. The line shows who asked, when, what they asked for and what answer they got. It also shows the size of the answer and the browser used. Nginx and Apache both write one by default. A separate error log keeps the problems.

## Example

Jack's site shows errors. He reads the access log and finds hundreds of 404 answers for one old link.

## Example code

```console
$ tail -n 1 /var/log/nginx/access.log
203.0.113.5 - - [16/Nov/2026:10:42:07 +0000] "GET /about HTTP/1.1" 200 5120 "-" "Mozilla/5.0"
```

One request, one line. Who asked, when, what for, the status code and the size.

## Why it matters

It is the first place to look when a page breaks or the traffic looks odd.

## Common mistake

Never rotating the log. It grows every day until the disk is full.

## Three principles

- **One line each.** Every request is written down.
- **Who, what, when.** Address, path, time and status.
- **Errors elsewhere.** Problems go to the error log.

## Related terms

- [Logging](https://learn.benibix.com/term/infrastructure/logging)
- [HTTP Status Code](https://learn.benibix.com/term/infrastructure/http-status-code)
- [HTTP Request](https://learn.benibix.com/term/infrastructure/http-request)
- [Nginx](https://learn.benibix.com/term/infrastructure/nginx)
- [Web Server](https://learn.benibix.com/term/infrastructure/web-server)

![A browser on the left sends a request to a web server such as Nginx or Apache. The web server reads plain files straight from its document root folder, and passes every other request to an application server, which reads a database. Each request also adds one line to an access log file.](https://learn.benibix.com/diagrams/inf2-web-server.svg)

---

Source: https://learn.benibix.com/term/infrastructure/access-log
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
