1.0.3 • Published 2 years ago

pino-redis-streams v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

pino-redis-streams

This packages provides "transport" for pino which forwards logs to Redis Streams.

Installation

npm install pino-redis-streams

Usage

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);

Options

  • 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.