Registry / devops / pino-redis-streams

pino-redis-streams

JSON →
library1.0.3jsnpmunverified

A pino transport that forwards logs to Redis Streams. Current version 1.0.3 enables high-throughput, structured logging into Redis Streams using the pino transport API. It leverages the node-redis client for Redis connectivity and supports TLS, authentication, and multiple stream keys. Compared to other Redis logging transports, it integrates directly with pino's pipeline, offering minimal overhead and async logging via pino's worker threads.

npm install pino-redis-streams
INSTALL
IMPORT
SIG · PINO-REDIS-STREAMS
P
pino-redis-streams
devopsjavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export (no named exports)
import { transport } from 'pino'; const transport = pino.transport({ target: 'pino-redis-streams', options: {...} });
import pinoRedisStreams from 'pino-redis-streams';
This package is a pino transport, not a constructor. Use it only as a target in pino.transport().
TypeScript types
import type { PinoRedisStreamsOptions } from 'pino-redis-streams'; (if types are exported, check types package)
import { PinoRedisStreamsOptions } from 'pino-redis-streams';
Types may be exported as named types; use type import to avoid runtime inclusion. Check package.json exports.
CommonJS require
const pino = require('pino'); const transport = pino.transport({ target: 'pino-redis-streams', options: {...} });
const stream = require('pino-redis-streams');
The package provides no direct require() export. Use pino.transport() with the target string.

Creates a pino logger that writes all log messages to a Redis Stream using pino-redis-streams transport.

import pino from 'pino'; const transport = pino.transport({ target: 'pino-redis-streams', options: { stream: 'my-log-stream', clientOptions: { socket: { host: 'localhost', port: 6379 }, password: process.env.REDIS_PASSWORD ?? '' } } }); const logger = pino(transport); logger.info('Hello Redis Stream!');
Debug
Known issues
gotchaThe option key is 'stream' (singular) in the options object, not 'streams' (plural) as might be expected.
fix
Use options: { stream: 'your-stream' } instead of streams.
affects: all
gotchaRedis credentials and host must be provided via clientOptions.password and clientOptions.socket. No environment variable auto-detection.
fix
Explicitly pass password and socket config in clientOptions.
affects: all
gotchaThe transport runs in a worker thread; any Redis connection errors will not propagate directly. Use pino's error event listeners or monitor the transport for failures.
fix
Attach an error listener: transport.on('error', (err) => console.error('Redis transport error', err)).
affects: all
deprecatedThis package uses the legacy 'stream' option. Future versions may rename to 'streams' or 'key' for clarity.
fix
Check for updated options in newer releases.
affects: =1.0.3
gotchaPino transport API only works with pino >=7. Using pino <7 will not recognize the transport target.
fix
Upgrade pino to version 7 or higher.
affects: all
Errors
Common errors & fixes
Error: stream is not a function
Importing pino-redis-streams as a function instead of using pino.transport({ target: ... }).
fix
Do not import directly; use pino.transport({ target: 'pino-redis-streams', options: {...} }).
TypeError: Cannot read properties of undefined (reading 'XADD')
Redis connection failed or clientOptions are incorrect (e.g., missing host/port/password).
fix
Verify Redis server is running and clientOptions has correct host, port, and password.
Error: ERR wrong number of arguments for 'XADD' command
The stream option was not provided (undefined) causing malformed XADD command.
fix
Ensure options.stream is a defined string (e.g., 'my-stream').
Error: Module not found: 'pino'
pino is not installed as a dependency.
fix
Install pino: npm install pino
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
pinorequiredpino is the logging framework; this package is a pino transport and requires pino >=7 for the transport API.
redisrequiredThe official Redis client used to connect to Redis and write to streams.
Agent activity
30 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
pino-redis-streams — npm install pino-redis-streams · libregistry