Skip to content

pg_logtap

Structured PostgreSQL log capture and delivery to Vector, HTTP, TCP, or files.

pg_logtap · Structured PostgreSQL log capture and delivery to Vector, HTTP, TCP, or files.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101916pg_logtappg_logtap0.6.2STATMITZig

PostgreSQL · 15, 16, 17, 18

Usage

Sources:

pg_logtap captures PostgreSQL log events in a shared-memory ring and can deliver them to a configured collector. Upstream verified PostgreSQL 15 through 18.

Enable and inspect

Append pg_logtap to the existing shared_preload_libraries list and restart PostgreSQL. Create its SQL objects as a superuser, then inspect delivery counters and recent events.

CREATE EXTENSION pg_logtap;
SELECT * FROM pg_logtap_delivery;
SELECT unnest(pg_logtap_dump(10));

pg_monitor can read delivery counters. Only the owner can execute pg_logtap_dump by default. Captured errors, queries and context can contain other sessions’ data. log_min_messages controls which messages reach the log.

Table reader