bunyan-express-serializer

Bunyan serializer for Express objects

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
bunyan-express-serializer
201.0.08 years ago8 years agoMinified + gzip package size for bunyan-express-serializer in KB

Readme

bunyan-express-serializer
Serialize Express-like request objects.
This Bunyan serializer
behaves like Bunyan's built-in req serializer, but handles the differences between the Node core req object (http.IncomingMessage) and the Express req objectexpress req object. Specifically, it adds logging of req.originalUrlreq.originalurl.
See node-bunyan#169
for motivation.

Usage

var log = require("bunyan").createLogger({
  serializers: {
    req: require("express-bunyan-serializer"),
  },
});

// ...
log.info({
  req: // Some Express req object with originalUrl
});

Installation

npm install express-bunyan-serializer