churchill
A winston express logger called churchill
Installing
npm install churchill
Running the tests
npm test
Usage
var churchill = ;app;
Specify a log level
app;
Using multiple loggers
var logger = new (winston.Logger).....
app.use(require('churchill').add(logger, 'express').add(logger, 'someOtherLogLevel'));
req.logger
The first logger will be automatically added to req.logger
This then gives you the facility to use the logger from req like so:
reqlogger;reqlogger;
req.log
Churchill will also add a log
method to the request object, which will log to all mounted loggers:
req;req;
To disable this set reqLogger to false in the options.
Formatting
var logger = new winstonLogger...app;
Suppressing GET params from logs
var churchill = churchilloptionslogGetParams = false
Output
In it's simplest form a console output looks like this:
info: status=200, method=GET, url=/, response_time=4
info: status=304, method=GET, url=/, response_time=1
info: status=304, method=GET, url=/, response_time=0
Examples
To run the examples go into the example dir and npm install
then just node simple
or node multiple
to see them in action.