# View logs

> Read the error, PHP, access, slow, cache, and cron logs live in the dashboard, search and filter them, download them, and clear them.

Source: https://docs.wpwaterfall.com/logs-viewer

The Log viewer shows the newest lines of each log for an environment, live. Open the site, pick the environment in the top bar, then choose **Logs**.

## Which logs are there?

| Tab | What it holds |
|---|---|
| `error.log` | Nginx errors: missing files, upstream timeouts, refused requests. |
| `php-error.log` | PHP warnings, notices, and fatal errors, and PHP-FPM pool messages. |
| `access.log` | One line per request. |
| `slow.log` | PHP requests that ran longer than 5 seconds, with the function they were stuck in. |
| `cache-perf.log` | The page cache result for each request: HIT, MISS, BYPASS, or EXPIRED. |
| `cron.log` | Every run of server cron: WordPress cron and your own cron jobs. Each run adds a line with its exit code and duration, then the end of its output. A failed run is marked as an error, and a run skipped because the last one was still going is marked as a warning. See [Cron jobs](https://docs.wpwaterfall.com/cron-jobs). |

## How do I read and search?

- **Lines** picks how many recent lines to load: 100, 500, or 1,000.
- **Live** adds new lines as they arrive. Turn it off to read without the view moving; new lines wait until you turn it back on.
- **Search** highlights matches in the loaded lines.
- Filter by **Error**, **Warning**, **Notice**, or **Info** to show one level.
- The reload button loads the lines again. The download button saves the last 1,000 lines as a file.

## How do I clear a log?

The clear button (the eraser) asks you to confirm, then empties the log, as a job in the job list and activity log. It works on live and on staging. Download the log first if you need the lines.

## Quick answers

**Which log do I start with?**
`php-error.log`, filtered to **Error**, for a broken page. `error.log` for 404s and timeouts.

**Should a new site have lines in `error.log`?**
No. A new site with no traffic writes no error lines. Requests from scanners for files such as `/.env` or `/.git/config` get a 404 and add nothing to the logs, and a refused one click login link shows in **User Activity**, not in the logs. Lines that appear later come from real requests, plugins, or themes.

**Why does `cache-perf.log` show BYPASS for a page?**
A page is not cached for a logged in visitor, a cart, a POST, or a static file. See [Edge cache and CDN](https://docs.wpwaterfall.com/edge-cache).

## API

- `GET /v1/environments/{id}/logs/{file}`
- `GET /v1/environments/{id}/logs/{file}/stream`
- `GET /v1/environments/{id}/logs/{file}/download`
- `POST /v1/environments/{id}/logs/{file}/clear` with `{"confirm": true}`

In the API, `{file}` is `error`, `php-fpm`, `access`, `slow`, `cache`, or `cron`. The stream endpoint sends server-sent events, one `LogStreamEvent` per data field.

## Related

- [Analytics](https://docs.wpwaterfall.com/analytics)
- [Edge cache and CDN](https://docs.wpwaterfall.com/edge-cache)
- [Change PHP settings](https://docs.wpwaterfall.com/tools-php-settings)
- [Jobs and progress](https://docs.wpwaterfall.com/jobs-and-progress)
