Skip to content

Log4Node reporter for the Hapi Good reporting system

License

Notifications You must be signed in to change notification settings

f8k8/good-log4node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

good-log4node

A hapi good-reporter to log4node logging adapter.

Installation

  $ npm install log4node
  $ npm install good-log4node

Usage

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

var GoodLog4Node = require('good-log4node');
var Log4Node = require('log4node');

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

The following options are availble to configure GoodLog4Node:

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

About

Log4Node reporter for the Hapi Good reporting system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published