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.
var log = require("bunyan").createLogger({
serializers: {
req: require("express-bunyan-serializer"),
},
});
// ...
log.info({
req: // Some Express req object with originalUrl
});
npm install express-bunyan-serializer