pgtail
An interactive PostgreSQL log tailer that finds your instances and colors what matters
pgtail> list # VERSION PORT STATUS LOG SOURCE DATA DIRECTORY 0 17 5432 running on process /var/lib/postgresql/17/main pgtail> tail 0 --stream Tailing /var/lib/postgresql/17/main/log/postgresql-Tue.log Press Ctrl+C to stop Detected format: text 10:30:05.118 [6021] LOG : duration: 1523.412 ms statement: SELECT id, total FROM orders WHERE customer_id = 42 10:30:07.234 [6025] ERROR : relation "users" does not exist at character 15 STATEMENT: SELECT * FROM users WHERE id = 1 10:30:09.871 [6027] WARNING: there is no transaction in progress 10:30:10.234 [6028] FATAL : password authentication failed for user "alice"
listFinds instances from running processes, pgrx, ankus, PGDATA, and the usual Homebrew, Debian, PGDG, Postgres.app, and Windows locations.
tailA full screen log that follows new rows, with vim keys, visual selection, the mouse, and a command line with suggestions.
levelFilters by severity, regular expression, time range, and csvlog or jsonlog fields, changed while the log keeps running.
highlightThirty semantic highlighters for SQL, durations, SQLSTATE codes, LSNs, locks, and more, plus your own patterns.
errorsError, connection, and query duration statistics, with trend sparklines and live counters.
notifyDesktop notifications for levels, patterns, error rates, and slow queries, with quiet hours.
exportWrites the filtered entries as text, JSON Lines, or CSV, or pipes them to any shell command.
dotnet tool install -g pgtail