Giter VIP home page Giter VIP logo

bunyan-redis-stream's Introduction

bunyan-redis-stream

Build Status

A lightweight Redis stream for Bunyan that can publish to a channel or push to a list.

Installation

npm install bunyan-redis-stream

Usage

node_redis

var bunyan = require('bunyan'),
    redis = require('redis'),
    RedisStream = require('bunyan-redis-stream'),
    client = redis.createClient();

var stream = new RedisStream({
  client : client,
  key    : 'logs',
  type   : 'channel'
});

var logger = bunyan.createLogger({
  name: 'bunyan-redis-stream',
  streams: [{
    type   : 'raw',
    level  : 'trace',
    stream : stream
  }]
});

ioredis

var bunyan = require('bunyan'),
    Redis = require('ioredis'),
    RedisStream = require('bunyan-redis-stream'),
    client = new Redis();

var stream = new RedisStream({
  client : client,
  key    : 'logs',
  type   : 'channel'
});

var logger = bunyan.createLogger({
  name: 'bunyan-redis-stream',
  streams: [{
    type   : 'raw',
    level  : 'trace',
    stream : stream
  }]
});

Params

Name Type Description
client object Redis client instance
[key=logs] string Name of Redis list or channel to use
[type=channel] string Method used in which to store log messages in Redis. Either list or channel.

Running Tests

General

npm test

Integration

Integration tests assume that a Redis server is running locally on port 6379 with no auth.

npm run integration

bunyan-redis-stream's People

Contributors

crwhite21 avatar

Watchers

 avatar

Forkers

keanuyaoo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.