A hapi good-reporter to log4node logging adapter.
$ npm install log4node
$ npm install good-log4node
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 (Defaulterror
). - ops_level: Map all good
ops
events to this Log4Node level (Defaultinfo
). - request_level: Map all good
request
events to this Log4Node level (Defaultinfo
). - response_level: Map all good
response
events to this Log4Node level (Defaultinfo
). - other_level: Map all other good events to this Log4Node level (Default
info
).