hapi process monitoring
Lead Maintainer: Adam Bretz
good is a hapi plugin to monitor and report on a variety of hapi server events as well as ops information from the host machine. It listens for events emitted by hapi server instances and pushes standardized events to a collection of streams.
const Hapi = ;const server = ;server;const options =ops:interval: 1000reporters:myConsoleReporter:module: 'good-squeeze'name: 'Squeeze'args: log: '*' response: '*'module: 'good-console''stdout'myFileReporter:module: 'good-squeeze'name: 'Squeeze'args: ops: '*'module: 'good-squeeze'name: 'SafeJson'module: 'good-file'args: './test/fixtures/awesome_log'myHTTPReporter:module: 'good-squeeze'name: 'Squeeze'args: error: '*'module: 'good-http'args: ''wreck:headers: 'x-api-key': 12345;server;
This example does the following:
myConsoleReporterlistening for 'response' and 'log' events and writes them to
myFileReporterto listen for 'ops' events and logs them to
myHTTPReporterto listen for error events and POSTs them to
http://prod.logs:3000with additional settings to passed into
See the Reporter Interface section of the API documentation on how to configure reporters.
NOTE: Ensure calling
server.connection prior to registering
response event listeners are only registered on connections that exist on
server at the time
Good is registered.
Looking for more examples? Check out the examples folder.
The following streams are maintained by the hapi community and are known to work with good. Any transform or write stream can work with good, these are just a few inside the hapijs organization.
See the API Reference.