spee.ch/server/middleware/requestLogger.js

9 lines
256 B
JavaScript
Raw Normal View History

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