Skip to content

Bunyan plugin for Cloudant. 'Stream' logs to Cloudant.

License

Notifications You must be signed in to change notification settings

cdimascio/bunyan-cloudant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bunyan-cloudant

This is a bunyan plugin for Cloudant. It allows you to 'stream' your bunyan logs to Cloudant.

A "stream" is Bunyan's name for where it outputs log messages

Install

npm install bunyan-cloudant

Usage

const bunyan = require('bunyan');
const CloudantStream = require('bunyan-cloudant');

const cloudantStream = new CloudantStream({
  cloudant: {
    url: process.env.COUCHDB_URL
  },
  dbName: 'server-logs'
});

export const L = bunyan.createLogger({
  name: 'my-app',
  streams: [{
    stream: process.stdout // stream to stdout
  }, {
    stream: cloudantStream // and stream to cloudant
  }]
});

Options

CloudantStream takes the following options

{
  cloudant: { // required
    uri: 'http://user:pass@www.cloudant.com'
  },
  dbName: 'logs', // required
  log: myParentBunyanLogger // optional
}

Required Props

The cloudant property (required) must conform to cloudant's Initialization object. See the Initialize section.

The dbName property (required) is the name Cloudant datbase that to 'stream' logs

The log property (optional) specifies a parent Bunyan logger

LICENSE

Apache 2.0

About

Bunyan plugin for Cloudant. 'Stream' logs to Cloudant.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published