winstonjs / winston-redis

A fixed-length Redis transport for winston
http://github.com/winstonjs/winston-redis
MIT License
41 stars 41 forks source link

winston-redis

A capped Redis transport for winston.

Requirements

Usage

  const winston = require('winston');
  const redisTransport = require('winston-redis');

  const logger = winston.createLogger({
    level: 'info',
    transports: [
      new redisTransport()
    ]
  });

  logger.log({
    level: "info",
    message: "redis is awesome",
    reason: "it's fast" // this will get stored as meta data
  });

This transport accepts the options accepted by the node-redis client:

In addition to these, the Redis transport also accepts the following options.

Metadata: Logged as JSON literal in Redis

Installation

Installing npm (node package manager)

  $ curl http://npmjs.org/install.sh | sh

Installing winston-redis

  $ npm install winston
  $ npm install winston-redis

Run Tests

Winston-redis tests are written in mocha, using Abstract Winston Transport and designed to be run with npm.

  npm test

Author: Charlie Robbins