npm

Join us for the upcoming webinar, "Enterprise JavaScript done right: the tools you love, the security you need."Sign up here »

@aftership/bunyan-redis

1.0.3 • Public • Published

bunyan-redis

What's changed in this fork

  • reduced ops by reusing results from push command
  • optimized trimming by applied drop factor
  • only accept well-initialized redis-client

Installation

npm install @aftership/bunyan-redis

Usage

With existing redis client connection.

var ioredis = require('ioredis');
var client = new ioredis({
    port: 6379,          // Redis port
    host: '127.0.0.1',   // Redis host
    db:15
});
var RedisTransport = require('../');
var bunyan = require('bunyan');
 
transport = new RedisTransport({
    container: 'logs:foo',
    client: client,
    drop_factor: 0.25,
    length:10,
    diagnosis: true
});
 
logger = bunyan.createLogger({
    name: 'name',
    streams: [{
        type: 'raw',
        level: 'trace',
        stream: transport
    }]
});

And with connection data.

Options

  • client - redis client instance
  • container - redis key
  • length: maximum size of log queue
  • drop_factor (optional): by which overflown logs are dropped, default = 0

install

npm i @aftership/bunyan-redis

Downloadsweekly downloads

43

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability