Registry / logging / bunyan-redis

bunyan-redis

JSON →
library0.1.4jsnpmunverified

A Bunyan stream transport for logging to Redis. Version 0.1.4 is the latest, though the package appears unmaintained (no recent updates). It allows sending log records to a Redis list or stream via the provided container key. Differentiates from other Bunyan transports by targeting Redis as a log backend. Suitable for centralized logging pipelines consuming from Redis.

npm install bunyan-redis
INSTALL
IMPORT
SIG · BUNYAN-REDIS
B
bunyan-redis
loggingjavascriptv0.1.4
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.

RedisTransport
import { RedisTransport } from 'bunyan-redis'
const RedisTransport = require('bunyan-redis').RedisTransport
The package exports a named export. CJS require must access the property.
default
import bunyanRedis from 'bunyan-redis'
const bunyanRedis = require('bunyan-redis')
Default export is the RedisTransport class. CJS require returns the module.exports object.
RedisTransport
const { RedisTransport } = require('bunyan-redis')
const RedisTransport = require('bunyan-redis')
Destructuring is required for CJS to get the class, not the module exports object.

Creates a Bunyan logger that writes raw log entries to a Redis list keyed by 'logs'.

import bunyan from 'bunyan'; import { RedisTransport } from 'bunyan-redis'; const transport = new RedisTransport({ container: 'logs', host: '127.0.0.1', port: 6379, db: 0 }); const logger = bunyan.createLogger({ name: 'bunyan-redis', streams: [{ type: 'raw', level: 'trace', stream: transport }] }); logger.info({ foo: 'bar' }, 'test log');
Debug
Known issues
gotchaStream type must be 'raw' to preserve object structure, not 'json'.
fix
Set stream type to 'raw' in Bunyan stream configuration.
affects: >=0.0.0
gotchaNo reconnection or error handling for Redis connection loss.
fix
Implement custom error handling on the Redis client before passing to transport.
affects: >=0.1.0
deprecatedPackage uses older redis driver API (e.g., no promise support).
fix
Consider switching to a maintained alternative or update the underlying redis client manually.
affects: >=0.0.0
gotchaThe 'container' option is the Redis key used for list push; logs are stored as serialized JSON strings.
fix
Ensure consumer reads from the correct Redis list using LRANGE or BLPOP.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: transport is not a stream
Stream type not set to 'raw' or transport not instantiated correctly.
fix
Add 'type: "raw"' to the stream config and ensure transport is an instance of RedisTransport.
Error: Redis connection to 127.0.0.1:6379 failed
Redis server not running or unreachable.
fix
Start Redis server or provide correct host/port.
ERR wrong number of arguments for 'rpush' command
Container name missing or empty.
fix
Provide a non-empty 'container' option.
Upgrade
Version history
0.1.4latest on npm
Audit
Dependencies
bunyanrequiredRequired peer dependency for creating Bunyan loggers and streams.
redisrequiredUsed to connect to Redis and publish log entries.
Agent activity
40 hits · last 30 days
node
32
OpenAI (training)
1
Resources
bunyan-redis — npm install bunyan-redis · libregistry