A Winston transport for logging messages to a PostgreSQL database. Version 0.0.4 – appears to be a mature but unmaintained package with limited releases. It supports both table-based logging (specifying a table with columns 'level', 'message', 'metadata') and PostgreSQL function-based logging. Key options include connection string, SSL toggle, timestamp, table name, database function, and an optional ignoreMessage filter. Requires Winston (version 0.x compatibility noted) and a running PostgreSQL instance. Differentiating from other transports: it uses connection string directly and supports custom database functions.
npm install winston-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Adds Postgres transport to winston using a connection string and table name, with SSL disabled and message filtering.
Provide either `tableName` or `databaseFunction` option.
Set `ssl: true` and ensure proper certificates in production.
Use const Postgres = require('winston-postgres').Postgres; or destructure.Ensure table has columns: level (text), message (text), metadata (jsonb or text).
const Postgres = require('winston-postgres').Postgres;Start PostgreSQL server or update connectionString to correct host/port.
Create table: CREATE TABLE winston-logs (level TEXT, message TEXT, metadata JSONB);