Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Created September 7, 2015 10:58
Show Gist options
  • Save davidgilbertson/f76f56e276a63a4f8499 to your computer and use it in GitHub Desktop.
Save davidgilbertson/f76f56e276a63a4f8499 to your computer and use it in GitHub Desktop.
const log = require('./log.js')('http:request');
export default (req, nes, next) => {
const httpRequest = {
method: req.method,
url: req.url,
headers: req.headers,
remoteAddress: req.connection.remoteAddress,
remotePort: req.connection.remotePort
};
log.info({httpRequest});
next();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment