Skip to content

natelaws/good-winston

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

good-winston

A hapi good-reporter to winston logging adapter.

Installation

  $ npm install winston
  $ npm install good-winston

Usage

To use the GoodWinston transport in winston, you simply need to require it and then either add it to an existing winston logger or pass an instance to a new winston logger:

var GoodWinston = require('good-winston');
var winston = require('winston');

server.register({
  register: require('good'),
  options: {
    reporters: [
      new GoodWinston({
        ops: '*',
        request: '*',
        response: '*',
        log: '*',
        error: '*'
      }, winston)
    ]
  }
}, function(err) {
  if (err) {
    return server.log(['error'], 'good load error: ' + err);
  }
});

The following options are availble to configure GoodWinston:

  • error_level: Map all good error events to this winston level (Default error).
  • ops_level: Map all good ops events to this winston level (Default info).
  • request_level: Map all good request events to this winston level (Default info).
  • response_level: Map all good response events to this winston level (Default info).
  • other_level: Map all other good events to this winston level (Default info).

About

hapi good-reporter to winston adapter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 100.0%