spee.ch/server/middleware/requestLogger.js

9 lines
254 B
JavaScript
Raw Normal View History

2018-03-29 12:21:23 -07:00
const logger = require('winston');
const requestLogger = (req, res, next) => { // custom logging middleware to log all incoming http requests
2018-04-08 19:54:09 -04:00
logger.debug(`Request on ${req.originalUrl} from ${req.ip}`);
2018-03-29 12:21:23 -07:00
next();
};
module.exports = requestLogger;