A fixed-length Redis transport for winston
Clone or download
mgibeau Merge pull request #29 from mgibeau/winston3-redislatest
Refactored for Winston 3 support
Latest commit c3b12d7 Sep 18, 2018



A capped Redis transport for winston.


  var winston = require('winston');
  // Requiring `winston-redis` will expose 
  // `winston.transports.Redis`
  winston.add(winston.transports.Redis, options);

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

  • host: (Default localhost) Remote host of the Redis server
  • port: (Default 6379) Port the Redis server is running on.
  • auth: (Default None) Password set on the Redis server

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

  • redis: Either the redis client or the options for the redis client
  • length: (Default 200) Number of log messages to store.
  • container: (Default winston) Name of the Redis container you wish your logs to be in.
  • channel: (Default None) Name of the Redis channel to stream logs from.
  • meta: (Default {}) Custom fields to add to each log.

Metadata: Logged as JSON literal in Redis


Installing npm (node package manager)

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

Installing winston-redis

  $ npm install winston
  $ npm install winston-redis

Run Tests

All of the winston tests are written in vows, and designed to be run with npm.

  npm test

Author: Charlie Robbins