1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/lib/middleware/request-logger.js

13 lines
283 B
JavaScript
Raw Normal View History

'use strict';
const logger = require('../logger')('HTTP');
module.exports = function(config) {
return (req, res, next) => {
next();
if (config.enableRequestLogger) {
logger.info(`${res.statusCode} ${req.method} ${req.baseUrl}`);
}
};
};