Loggly writable stream.
good-loggly
is a writable stream that is used to send events to Loggly. Below is an example of how to use it with the good logger for hapi.
Credit: This module was originally written and maintained by fhemberger.
[email protected]
is compatible with version >=3.x.x.[email protected]
is compatible with version 1.x.x and 2.x.x.- For older versions of
good
, use v0.1.4.
Example integration:
var Hapi = require('hapi');
var Good = require('good');
var server = new Hapi.Server();
var options = {
reporters: {
loggly: [{
module: 'good-squeeze',
name: 'Squeeze',
args: [{log: '*', request: '*', error: '*', response: '*'}]
}, {
module: 'good-loggly',
args: [{
token: 'YOUR LOGGLY TOKEN',
subdomain: 'YOUR LOGGLY SUBDOMAIN',
name: 'myapp',
hostname: 'myapp.example.com',
tags: ['global', 'tags', 'for', 'all', 'requests']
}]
}]
}
};
server.register({
register: Good,
options: options
}, function (err) {
if (err) {
return console.error(err);
}
});