0.1.3 • Published 9 years ago

redis-transport v0.1.3

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

redis-transport - a node.js logger for winston to redis

Install with: - npm install redis - npm install winston - npm install redis-transport

Usage

Simple example:

    var redis = require('redis');
    var winston = require('winston');
    var RedisTransport = require('redis-transport').Redis;
    var logger = new (winston.logger)({
        new RedisTransport({
            level: 'info',
            silent: false,
            host: 'localhost',
            port: 7777,
            channel: 'logs',
            timestamp: function(){return new Date();},
            formatter: function(options){ //definition formatter by yourself
                return ' ['+ options.timestamp() + '] ' + (options.message || '') + (options.meta && Object.keys(options.meta).length ? '\n\t' + JSON.stringify(options.meta) : '');
            }
        })
    });

This will write winston logs into redis pub/sub;

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago