request-error-log-middleware
v1.0.3
Published
Log an [express](https://github.com/visionmedia/express) request if the response has a bad status code.
Downloads
3
Readme
request-error-log-middleware
Log an express request if the response has a bad status code.
Example
var errorLog = require('request-error-log-middleware');
var logger = new require('winston').Logger();
var app = express();
app.configure('production', function () {
app.use(errorLog(logger));
});
API
errorLog(logger, statuses)
Return a request error logger middleware with custom statuses
:
{
404: logger.warn, // warn if its a 404
'*': logger.error // error if its anything else
}
License
WWWWWW||WWWWWW
W W W||W W W
||
( OO )__________
/ | \
/o o| MIT \
\___/||_||__||_|| *
|| || || ||
_||_|| _||_||
(__|__|(__|__|