Skip to content

harrisiirak/bunyan-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bunyan-redis

Bunyan redis transport

Installation

npm install bunyan-redis

Usage

With existing redis client connection.

var client = redis.createClient();

var transport = new RedisTransport({
  container: 'logs',
  client: client
});

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

And with connection data.

var transport = new RedisTransport({
  container: 'logs',
  host: '127.0.0.1',
  port: 6379,
  password: 'password'
  db: 0
});

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

Options

  • host - redis hostname
  • port - redis port
  • db - redis database index
  • password - redis password
  • client - redis client instance
  • container - redis key

Tests

npm test

About

Bunyan redis transport

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published