bunyan-express-serializer
v1.0.0
Published
Bunyan serializer for Express objects
Downloads
2,811
Maintainers
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
object. Specifically, it adds logging of
req.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