# Turn query capture on and off

> Capture is per instance and off by default. See what it changes on PostgreSQL and MySQL, what it costs, and how turning it off restores config.

Source: https://sqleye.com/docs/live-eye/capture/ · Last updated: 2026-11-29 · Publisher: CodeROG (https://coderog.com)

Use the **Capture** toggle in the instance header. It is available only while the instance is running, and it is off by default for every instance. Turning it off returns the server to its normal configuration.

## Why is capture off by default?

Recording every statement costs the database throughput. SQLEye does it only when you ask, per instance. With capture off, SQLEye does no capture work.

## What does capture do on PostgreSQL?

The instance's managed `sqleye.conf` always contains these settings, and SQLEye tails the resulting JSON log. Capture changes only the last row:

| Setting | Value |
|---|---|
| `logging_collector` | `on` |
| `log_destination` | `'jsonlog'` (needs PostgreSQL 15 or later; every version SQLEye offers qualifies) |
| `log_directory` | the instance's `logs` folder |
| `log_filename` | `'postgresql-%a.log'` |
| `log_rotation_age` | `1d` |
| `log_rotation_size` | `32MB` |
| `log_truncate_on_rotation` | `on` |
| `log_min_duration_statement` | `0` while capture is on, `-1` while off |

Toggling capture applies the change with `pg_reload_conf()`, so no restart is needed. Each event carries duration, connection id, database, user and application name. Failed statements appear with their error. SQLEye's own admin connections use the application name `sqleye` and are excluded.

Log files are named by weekday and truncated on rotation, so older logs are overwritten. While capture is on, these files contain statement text. See [Privacy and data](/docs/privacy-and-data/).

## What does capture do on MySQL?

The managed `my.cnf` keeps `performance_schema` on. While capture is on, SQLEye enables the `events_statements_history_long` consumer (history size 10000) and reads it every 250 ms. Events carry SQL text, duration, rows sent or affected, rows examined, "No index used", schema, error message, connection id and user. SQLEye's own thread is excluded.

> **Caution.**
If more statements arrive between two reads than the history holds, some can be missed.

## How do I turn it on or off?

1. Start the instance.
2. Open it and switch **Capture** on. The Live tab starts filling as your application runs queries.
3. Switch **Capture** off when you are done. The server's normal config is restored.

If capture is off, the Live tab shows "Capture is off for this instance" with a toggle.

## Is anything left behind?

Captured queries stay in memory only. The managed config files (`sqleye.conf` for PostgreSQL, `my.cnf` for MySQL) begin with "Managed by SQLEye - edits are overwritten", so do not edit them by hand.

If nothing appears, see [No queries showing](/docs/troubleshooting/no-queries-showing/).
