Skip to content

Turn query capture on and off

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.

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

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.

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.

  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.

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.

SQLEye is developed and maintained by CodeROG. This page is also available as Markdown.