bunyan-pilgrim
Pilgrim is a logging stream for trentm's node-bunyan module designed to work in conjunction with mcavage's node-restify server.
It allows you to direct a specific range of status codes to individual log files. For example, you can easily separate all client errors (4xx) from server errors (5xx) and successful requests (2xx) into a separate file for each category.
You can also ignore specific error codes, giving you greater control over your logging operations.
Installation
npm install bunyan-pilgrim
Usage
var bunyan = ;var Pilgrim = ; var logger = bunyan; server = restify;
Configuration
Each Pilgrim is configured with a hash that includes the following:
from
: the first status code that must be captured in this logto
: the last status code that msut be captured in this logstream
: either a string containing the path of the log file, or an instance of Stream.Writable.ignore
: an optional array of status codes that fall betweenfrom
andto
but should be ignored anyway.
Contributing
Contributions are welcome… particularly if accompanied by a unit test.