spee.ch/server/middleware/requestLogger.js
2018-04-08 19:54:09 -04:00

8 lines
254 B
JavaScript

const logger = require('winston');
const requestLogger = (req, res, next) => { // custom logging middleware to log all incoming http requests
logger.debug(`Request on ${req.originalUrl} from ${req.ip}`);
next();
};
module.exports = requestLogger;