This packages provides "transport" for pino which forwards logs to Redis Streams.
npm install pino-redis-streams
You can use this transport as follows:
import pino from 'pino';
const transport = pino.transport({
target: 'pino-redis-streams',
options: {
streams: 'my-log-stream',
clientOptions: {
socket: {
port: 6380,
host: 'my.redis.server.com',
tls: true,
},
password: 'supersecurepassword',
},
},
});
pino(transport);
stream
(string | string[]) a string or an array of strings of stream keys to which you want to send the logs.clientOptions
(_RedisClientOptions) the Redis client options found in the official docs of Redis.