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