request-size-log-middleware

Log an [express](https://github.com/visionmedia/express) request if the request body or response body is too large.

npm install request-size-log-middleware
5 downloads in the last week
11 downloads in the last month

request-size-log-middleware

Log an express request if the request body or response body is too large.

Example

var sizeLog = require('request-size-log-middleware');
var logger = new require('winston').Logger();

var app = express();

app.configure('production', function () {
  app.use(sizeLog(logger));
});

API

sizeLog(logger, thresholds)

Return a sizelog middleware with custom thresholds:

{
    "warn": bytes('1mb'), // logger.warn after 1mb
    "error": bytes('2mb') // logger.error after 2mb
}

License

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|
npm loves you